Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1.C

raw
1 // { dg-do compile { target c++20 } }
2 // { dg-additional-options "-fabi-version=18 -fabi-compat-version=18" }
3 // { dg-final { scan-assembler "_Z1gI1XEvT_" } }
4 // { dg-final { scan-assembler "_Z1gI1YEvT_" } }
5 // { dg-final { scan-assembler "_Z1gIiEvT_" } }
6
7 template<typename T>
8 concept C = __is_class(T);
9
10 template<typename T>
11 concept D = C<T> && __is_empty(T);
12
13 struct X { };
14 struct Y { int n; };
15
16 template<typename T> void g(T) { } // #1
17 template<C T> void g(T) { } // #2
18 template<D T> void g(T) { } // #3
19
20 template void g(int); // Instantiate #1
21 template void g(X); // Instantitae #3
22 template void g(Y); // Instantiate #2
23
24 int main() { }