r348408 - Add dump tests for inherited default template parameters
Stephen Kelly via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 5 13:01:01 PST 2018
Surely all of the tests specifically about template decls should be moved?
On 05/12/2018 20:31, Aaron Ballman wrote:
> On Wed, Dec 5, 2018 at 3:24 PM Stephen Kelly via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
>> Author: steveire
>> Date: Wed Dec 5 12:21:13 2018
>> New Revision: 348408
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=348408&view=rev
>> Log:
>> Add dump tests for inherited default template parameters
>>
>> Modified:
>> cfe/trunk/test/AST/ast-dump-decl.cpp
> Can you move these tests into ast-dump-template-decls.cpp?
>
> ~Aaron
>
>> Modified: cfe/trunk/test/AST/ast-dump-decl.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/AST/ast-dump-decl.cpp?rev=348408&r1=348407&r2=348408&view=diff
>> ==============================================================================
>> --- cfe/trunk/test/AST/ast-dump-decl.cpp (original)
>> +++ cfe/trunk/test/AST/ast-dump-decl.cpp Wed Dec 5 12:21:13 2018
>> @@ -263,6 +263,15 @@ namespace testClassTemplateDecl {
>> template<typename T1> class TestClassTemplatePartial<T1, A> {
>> int j;
>> };
>> +
>> + template<typename T = int> struct TestTemplateDefaultType;
>> + template<typename T> struct TestTemplateDefaultType { };
>> +
>> + template<int I = 42> struct TestTemplateDefaultNonType;
>> + template<int I> struct TestTemplateDefaultNonType { };
>> +
>> + template<template<typename> class TT = TestClassTemplate> struct TestTemplateTemplateDefaultType;
>> + template<template<typename> class TT> struct TestTemplateTemplateDefaultType { };
>> }
>> // CHECK: ClassTemplateDecl{{.*}} TestClassTemplate
>> // CHECK-NEXT: TemplateTypeParmDecl
>> @@ -316,6 +325,24 @@ namespace testClassTemplateDecl {
>> // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplatePartial
>> // CHECK-NEXT: FieldDecl{{.*}} j
>>
>> +// CHECK: ClassTemplateDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} {{.*}} TestTemplateDefaultType
>> +// CHECK-NEXT: TemplateTypeParmDecl
>> +// CHECK-NEXT: TemplateArgument type 'int'
>> +// CHECK-NEXT: inherited from TemplateTypeParm 0x{{[^ ]*}} 'T'
>> +
>> +// CHECK: ClassTemplateDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} {{.*}} TestTemplateDefaultNonType
>> +// CHECK-NEXT: NonTypeTemplateParmDecl
>> +// CHECK-NEXT: TemplateArgument expr
>> +// CHECK-NEXT: ConstantExpr
>> +// CHECK-NEXT: IntegerLiteral
>> +// CHECK-NEXT: inherited from NonTypeTemplateParm 0x{{[^ ]*}} 'I' 'int'
>> +
>> +// CHECK: ClassTemplateDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} {{.*}} TestTemplateTemplateDefaultType
>> +// CHECK-NEXT: TemplateTemplateParmDecl
>> +// CHECK-NEXT: TemplateTypeParmDecl
>> +// CHECK-NEXT: TemplateArgument
>> +// CHECK-NEXT: inherited from TemplateTemplateParm 0x{{[^ ]*}} 'TT'
>> +
>> // PR15220 dump instantiation only once
>> namespace testCanonicalTemplate {
>> class A {};
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list