1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++2a -ast-dump -ast-dump-filter Foo %s | FileCheck -strict-whitespace %s
3 // Test with serialization:
4 // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown -emit-pch -o %t %s
5 // RUN: %clang_cc1 -x c++ -std=c++20 -triple x86_64-unknown-unknown -include-pch %t \
6 // RUN: -ast-dump-all -ast-dump-filter Foo /dev/null \
7 // RUN: | FileCheck --strict-whitespace %s
10 concept unary_concept
= true;
12 template <typename T
, typename U
>
13 concept binary_concept
= true;
15 template <typename
... Ts
>
16 concept variadic_concept
= true;
20 // CHECK: TemplateTypeParmDecl {{.*}} referenced Concept {{.*}} 'binary_concept'
21 // CHECK-NEXT: `-ConceptSpecializationExpr {{.*}} <col:13, col:31> 'bool' Concept {{.*}} 'binary_concept'
22 // CHECK-NEXT: |-TemplateArgument {{.*}} type 'R'
23 // CHECK-NEXT: | `-TemplateTypeParmType {{.*}} 'R'
24 // CHECK-NEXT: | `-TemplateTypeParm {{.*}} 'R'
25 // CHECK-NEXT: `-TemplateArgument {{.*}} type 'int'
26 // CHECK-NEXT: `-BuiltinType {{.*}} 'int'
27 template <binary_concept
<int> R
>
30 // CHECK: TemplateTypeParmDecl {{.*}} referenced Concept {{.*}} 'unary_concept'
31 // CHECK-NEXT: `-ConceptSpecializationExpr {{.*}} <col:13> 'bool'
32 template <unary_concept R
>
35 // CHECK: FunctionTemplateDecl {{.*}} <line:[[@LINE+1]]:3, line:[[@LINE+2]]:39> {{.*}} Foo<T>
37 Foo(R
, int) requires unary_concept
<R
>;
39 // CHECK: FunctionTemplateDecl {{.*}} <line:[[@LINE+1]]:3, line:[[@LINE+3]]:3> {{.*}} Foo<T>
41 Foo(R
, char) requires unary_concept
<R
> {
44 // CHECK: CXXFoldExpr {{.*}} <col:13, col:29>
45 template <variadic_concept
... Ts
>
48 // CHECK: CXXFoldExpr {{.*}} <col:13, col:34>
49 template <variadic_concept
<int>... Ts
>