r348408 - Add dump tests for inherited default template parameters

Stephen Kelly via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 5 12:21:14 PST 2018


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

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 {};




More information about the cfe-commits mailing list