[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / clang / test / AST / constraints-explicit-instantiation.cpp
blob79948ad1e85567561e70cd2eaa5166d24bfda72c
1 // RUN: %clang_cc1 -std=c++20 -ast-dump %s | FileCheck %s
3 namespace PR46029 {
5 template <int N>
6 void canary1();
7 template <int N>
8 void canary2();
10 template <int N>
11 struct A {
12 void f() requires(N == 1) {
13 static_assert(N == 1);
14 canary1<N>();
16 void f() requires(N == 2) {
17 static_assert(N == 2);
18 canary2<N>();
22 // This checks that `canary1<1>` and `canaray2<2>` are instantiated, thus
23 // indirectly validating that the correct candidates of `A::f` were really
24 // instantiated each time.
25 // The `static_assert`s validate we don't instantiate wrong candidates.
27 // CHECK:{{.*}}FunctionTemplateDecl {{.*}} canary1
28 // CHECK: {{.*}}TemplateArgument integral
29 // CHECK-SAME: {{'1'$}}
30 template struct A<1>;
32 // CHECK: {{.*}}FunctionTemplateDecl {{.*}} canary2
33 // CHECK: {{.*}}TemplateArgument integral
34 // CHECK-SAME: {{'2'$}}
35 template struct A<2>;
37 template struct A<3>;