Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / temp / temp.constr / temp.constr.decl / func-template-decl.cpp
blob30fbec64eea78238d5f423cef1b15ccec607f7a0
1 // RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
3 namespace nodiag {
5 template <typename T> requires (bool(T()))
6 int A();
7 template <typename U> requires (bool(U()))
8 int A();
10 } // end namespace nodiag
12 namespace diag {
14 namespace orig {
15 template <typename T> requires true
16 int A();
17 template <typename T>
18 int B();
19 template <typename T> requires true
20 int C();
23 template <typename T>
24 int orig::A();
25 // expected-error@-1{{out-of-line declaration of 'A' does not match any declaration in namespace 'diag::orig'}}
26 template <typename T> requires true
27 int orig::B();
28 // expected-error@-1{{out-of-line declaration of 'B' does not match any declaration in namespace 'diag::orig'}}
29 template <typename T> requires (!0)
30 int orig::C();
31 // expected-error@-1{{out-of-line declaration of 'C' does not match any declaration in namespace 'diag::orig'}}
33 } // end namespace diag
35 namespace nodiag {
37 struct AA {
38 template <typename T> requires (someFunc(T()))
39 int A();
42 template <typename T> requires (someFunc(T()))
43 int AA::A() { return sizeof(T); }
45 } // end namespace nodiag
47 namespace diag {
49 template <unsigned N>
50 struct TA {
51 template <template <unsigned> class TT> requires TT<N>::happy
52 int A();
55 template <unsigned N>
56 template <template <unsigned> class TT> int TA<N>::A() { return sizeof(TT<N>); }
57 // expected-error@-1{{out-of-line definition of 'A' does not match any declaration in 'TA<N>'}}
59 } // end namespace diag