xref: /llvm-project/clang/test/SemaCXX/PR68885.cpp (revision a413c563bdcaac08f7c325c7d69e19f924435e59)
1 // RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s
2 
3 // expected-no-diagnostics
4 
5 template <decltype(auto) a>
6 struct S {
7     static constexpr int i = 42;
8 };
9 
10 template <decltype(auto) a> requires true
11 struct S<a> {
12     static constexpr int i = 0;
13 };
14 
15 static constexpr int a = 0;
16 
test()17 void test() {
18     static_assert(S<a>::i == 0);
19     static_assert(S<(a)>::i == 0);
20     static_assert(S<((a))>::i == 0);
21 }
22