1 // RUN: %clang_cc1 -std=c++26 -ast-dump -ast-dump-filter=Test %s | FileCheck %s
3 template <template <class> class TT
> using N
= TT
<int>;
7 template <class T
> struct A
;
9 using TestQualified
= N
<foo::A
>;
10 } // namespace qualified
12 // CHECK: Dumping qualified::TestQualified:
13 // CHECK-NEXT: TypeAliasDecl
14 // CHECK-NEXT: `-ElaboratedType
15 // CHECK-NEXT: `-TemplateSpecializationType
16 // CHECK-NEXT: |-name: 'N' qualified
17 // CHECK-NEXT: | `-TypeAliasTemplateDecl {{.+}} N{{$}}
18 // CHECK-NEXT: |-TemplateArgument template 'foo::A':'qualified::foo::A' qualified{{$}}
19 // CHECK-NEXT: | |-NestedNameSpecifier Namespace 0x{{.+}} 'foo'{{$}}
20 // CHECK-NEXT: | `-ClassTemplateDecl {{.+}} A{{$}}
23 template <class T
> struct B
{
24 using TestDependent
= N
<T::template X
>;
26 } // namespace dependent
28 // CHECK: Dumping dependent::B::TestDependent:
29 // CHECK-NEXT: TypeAliasDecl
30 // CHECK-NEXT: `-ElaboratedType
31 // CHECK-NEXT: `-TemplateSpecializationType
32 // CHECK-NEXT: |-name: 'N' qualified
33 // CHECK-NEXT: | `-TypeAliasTemplateDecl
34 // CHECK-NEXT: |-TemplateArgument template 'T::template X':'type-parameter-0-0::template X' dependent{{$}}
35 // CHECK-NEXT: | `-NestedNameSpecifier TypeSpec 'T'{{$}}
38 template <class> struct A
;
40 template <template <class> class TT
> struct B
{
41 template <template <class> class> struct C
{};
44 using TestSubst
= B
<A
>::type
;
47 // CHECK: Dumping subst::TestSubst:
48 // CHECK-NEXT: TypeAliasDecl
49 // CHECK-NEXT: `-ElaboratedType
50 // CHECK-NEXT: `-TypedefType
51 // CHECK-NEXT: |-TypeAlias
52 // CHECK-NEXT: `-ElaboratedType
53 // CHECK-NEXT: `-TemplateSpecializationType
54 // CHECK-NEXT: |-name: 'C':'subst::B<subst::A>::C' qualified
55 // CHECK-NEXT: | `-ClassTemplateDecl {{.+}} C
56 // CHECK-NEXT: |-TemplateArgument template 'subst::A' subst index 0
57 // CHECK-NEXT: | |-parameter: TemplateTemplateParmDecl {{.+}} depth 0 index 0 TT{{$}}
58 // CHECK-NEXT: | |-associated ClassTemplateSpecialization {{.+}} 'B'{{$}}
59 // CHECK-NEXT: | `-replacement:
60 // CHECK-NEXT: | `-ClassTemplateDecl {{.+}} A{{$}}