xref: /llvm-project/clang/test/CXX/temp/temp.constr/temp.constr.decl/var-template-decl.cpp (revision b65b1f322bd88513586a4539d2b5f18aeb698f3f)
1 // RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
2 
3 namespace nodiag {
4 
5 struct B {
6     template <typename T> requires (bool(T()))
7     static int A;
8 };
9 
10 template <typename U> requires (bool(U()))
11 int B::A = int(U());
12 
13 } // end namespace nodiag
14 
15 namespace diag {
16 
17 struct B {
18     template <typename T> requires (bool(T())) // expected-note{{previous template declaration is here}}
19     static int A;
20 };
21 
22 template <typename U> requires (!bool(U()))  // expected-error{{requires clause differs in template redeclaration}}
23 int B::A = int(U());
24 
25 } // end namespace diag