[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / AST / ast-dump-using-template.cpp
blobde3ce277fd24f4bf92b69720b0f8ecab6844592c
1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++17 -ast-dump %s | FileCheck -strict-whitespace %s
3 // Tests to verify we construct correct using template names.
4 // TemplateNames are not dumped, so the sugar here isn't obvious. However
5 // the "using" on the TemplateSpecializationTypes shows that the
6 // UsingTemplateName is present.
7 namespace ns {
8 template<typename T> class S {
9 public:
10 S(T);
12 template<typename T> struct S2 { S2(T); };
13 template <typename T> S2(T t) -> S2<T>;
15 using ns::S;
16 using ns::S2;
18 // TemplateName in TemplateSpecializationType.
19 template<typename T>
20 using A = S<T>;
21 // CHECK: TypeAliasDecl
22 // CHECK-NEXT: `-ElaboratedType {{.*}} 'S<T>' sugar dependent
23 // CHECK-NEXT: `-TemplateSpecializationType {{.*}} 'S<T>' dependent using S
25 // TemplateName in TemplateArgument.
26 template <template <typename> class T> class X {};
27 using B = X<S>;
28 // CHECK: TypeAliasDecl
29 // CHECK-NEXT: `-ElaboratedType {{.*}} 'X<ns::S>' sugar
30 // CHECK-NEXT: `-TemplateSpecializationType {{.*}} 'X<ns::S>' sugar X
31 // CHECK-NEXT: |-TemplateArgument using template S
32 // CHECK-NEXT: `-RecordType {{.*}} 'X<ns::S>'
33 // CHECK-NEXT: `-ClassTemplateSpecialization {{.*}} 'X'
35 // TemplateName in DeducedTemplateSpecializationType.
36 S DeducedTemplateSpecializationT(123);
37 using C = decltype(DeducedTemplateSpecializationT);
38 // CHECK: DecltypeType {{.*}}
39 // CHECK-NEXT: |-DeclRefExpr {{.*}}
40 // CHECK-NEXT: `-ElaboratedType {{.*}} 'S<int>' sugar
41 // CHECK-NEXT: `-DeducedTemplateSpecializationType {{.*}} 'ns::S<int>' sugar using
43 S2 DeducedTemplateSpecializationT2(123);
44 using D = decltype(DeducedTemplateSpecializationT2);
45 // CHECK: DecltypeType {{.*}}
46 // CHECK-NEXT: |-DeclRefExpr {{.*}}
47 // CHECK-NEXT: `-ElaboratedType {{.*}} 'S2<int>' sugar
48 // CHECK-NEXT: `-DeducedTemplateSpecializationType {{.*}} 'S2<int>' sugar using