Mercurial > hg > CbC > CbC_llvm
comparison clang/test/AST/ast-dump-concepts.cpp @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++2a -ast-dump -ast-dump-filter Foo %s | FileCheck -strict-whitespace %s | |
2 | |
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 | |
8 | |
9 template <typename T> | |
10 concept unary_concept = true; | |
11 | |
12 template <typename T, typename U> | |
13 concept binary_concept = true; | |
14 | |
15 template <typename... Ts> | |
16 concept variadic_concept = true; | |
17 | |
18 template <typename T> | |
19 struct Foo { | |
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> | |
28 Foo(R); | |
29 | |
30 // CHECK: TemplateTypeParmDecl {{.*}} referenced Concept {{.*}} 'unary_concept' | |
31 // CHECK-NEXT: `-ConceptSpecializationExpr {{.*}} <col:13> 'bool' | |
32 template <unary_concept R> | |
33 Foo(R); | |
34 | |
35 // CHECK: FunctionTemplateDecl {{.*}} <line:[[@LINE+1]]:3, line:[[@LINE+2]]:39> {{.*}} Foo<T> | |
36 template <typename R> | |
37 Foo(R, int) requires unary_concept<R>; | |
38 | |
39 // CHECK: FunctionTemplateDecl {{.*}} <line:[[@LINE+1]]:3, line:[[@LINE+3]]:3> {{.*}} Foo<T> | |
40 template <typename R> | |
41 Foo(R, char) requires unary_concept<R> { | |
42 } | |
43 | |
44 // CHECK: CXXFoldExpr {{.*}} <col:13, col:29> | |
45 template <variadic_concept... Ts> | |
46 Foo(); | |
47 | |
48 // CHECK: CXXFoldExpr {{.*}} <col:13, col:34> | |
49 template <variadic_concept<int>... Ts> | |
50 Foo(); | |
51 }; |