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.
8 template<typename T
> class S
{
15 // TemplateName in TemplateSpecializationType.
18 // CHECK: TypeAliasDecl
19 // CHECK-NEXT: `-ElaboratedType {{.*}} 'S<T>' sugar dependent
20 // CHECK-NEXT: `-TemplateSpecializationType {{.*}} 'S<T>' dependent using S
22 // TemplateName in TemplateArgument.
23 template <template <typename
> class T
> class X
{};
25 // CHECK: TypeAliasDecl
26 // CHECK-NEXT: `-ElaboratedType {{.*}} 'X<ns::S>' sugar
27 // CHECK-NEXT: `-TemplateSpecializationType {{.*}} 'X<ns::S>' sugar X
28 // CHECK-NEXT: |-TemplateArgument using template S
29 // CHECK-NEXT: `-RecordType {{.*}} 'X<ns::S>'
30 // CHECK-NEXT: `-ClassTemplateSpecialization {{.*}} 'X'
32 // TemplateName in DeducedTemplateSpecializationType.
33 S
DeducedTemplateSpecializationT(123);
34 using C
= decltype(DeducedTemplateSpecializationT
);
35 // CHECK: DecltypeType {{.*}}
36 // CHECK-NEXT: |-DeclRefExpr {{.*}}
37 // CHECK-NEXT: `-ElaboratedType {{.*}} 'S<int>' sugar
38 // CHECK-NEXT: `-DeducedTemplateSpecializationType {{.*}} 'ns::S<int>' sugar using