[clang] 271cc58 - [NFC] clang: Implement tests for PR56099

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 21 09:35:23 PDT 2022


Author: Matheus Izvekov
Date: 2022-06-21T18:35:17+02:00
New Revision: 271cc588054a90abf0d82f57af272c3db749ff56

URL: https://github.com/llvm/llvm-project/commit/271cc588054a90abf0d82f57af272c3db749ff56
DIFF: https://github.com/llvm/llvm-project/commit/271cc588054a90abf0d82f57af272c3db749ff56.diff

LOG: [NFC] clang: Implement tests for PR56099

Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>

Differential Revision: https://reviews.llvm.org/D128112

Added: 
    

Modified: 
    clang/test/AST/ast-dump-template-decls.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/AST/ast-dump-template-decls.cpp b/clang/test/AST/ast-dump-template-decls.cpp
index 616a96902eff4..13050eee7aeda 100644
--- a/clang/test/AST/ast-dump-template-decls.cpp
+++ b/clang/test/AST/ast-dump-template-decls.cpp
@@ -127,3 +127,38 @@ using type2 = typename C<int>::type1<void>;
 // CHECK-NEXT: SubstTemplateTypeParmType 0x{{[^ ]*}} 'int' sugar
 // CHECK-NEXT: TemplateTypeParmType 0x{{[^ ]*}} 'T' dependent depth 0 index 0
 } // namespace PR55886
+
+namespace PR56099 {
+template <typename... As> struct Y;
+template <typename... Bs> using Z = Y<Bs...>;
+template <typename... Cs> struct foo {
+  template <typename... Ds> using bind = Z<Ds..., Cs...>;
+};
+using t1 = foo<int, short>::bind<char, float>;
+// CHECK:      TemplateSpecializationType 0x{{[^ ]*}} 'Y<char, float, int, short>' sugar Y
+// CHECK:      SubstTemplateTypeParmType 0x{{[^ ]*}} 'char' sugar
+// CHECK-NEXT: TemplateTypeParmType 0x{{[^ ]*}} 'Bs' dependent contains_unexpanded_pack depth 0 index 0 pack
+// CHECK:      SubstTemplateTypeParmType 0x{{[^ ]*}} 'float' sugar
+// CHECK-NEXT: TemplateTypeParmType 0x{{[^ ]*}} 'Bs' dependent contains_unexpanded_pack depth 0 index 0 pack
+// CHECK:      SubstTemplateTypeParmType 0x{{[^ ]*}} 'int' sugar
+// CHECK-NEXT: TemplateTypeParmType 0x{{[^ ]*}} 'Bs' dependent contains_unexpanded_pack depth 0 index 0 pack
+// CHECK:      SubstTemplateTypeParmType 0x{{[^ ]*}} 'short' sugar
+// CHECK-NEXT: TemplateTypeParmType 0x{{[^ ]*}} 'Bs' dependent contains_unexpanded_pack depth 0 index 0 pack
+
+template <typename... T> struct D {
+  template <typename... U> using B = int(int (*...p)(T, U));
+};
+using t2 = D<float, char>::B<int, short>;
+// CHECK:      TemplateSpecializationType 0x{{[^ ]*}} 'B<int, short>' sugar alias B
+// CHECK:      FunctionProtoType 0x{{[^ ]*}} 'int (int (*)(float, int), int (*)(char, short))' cdecl
+// CHECK:      FunctionProtoType 0x{{[^ ]*}} 'int (float, int)' cdecl
+// CHECK:      SubstTemplateTypeParmType 0x{{[^ ]*}} 'float' sugar
+// CHECK-NEXT: TemplateTypeParmType 0x{{[^ ]*}} 'T' dependent contains_unexpanded_pack depth 0 index 0 pack
+// CHECK:      SubstTemplateTypeParmType 0x{{[^ ]*}} 'int' sugar
+// CHECK-NEXT: TemplateTypeParmType 0x{{[^ ]*}} 'U' dependent contains_unexpanded_pack depth 0 index 0 pack
+// CHECK:      FunctionProtoType 0x{{[^ ]*}} 'int (char, short)' cdecl
+// CHECK:      SubstTemplateTypeParmType 0x{{[^ ]*}} 'char' sugar
+// CHECK-NEXT: TemplateTypeParmType 0x{{[^ ]*}} 'T' dependent contains_unexpanded_pack depth 0 index 0 pack
+// CHECK:      SubstTemplateTypeParmType 0x{{[^ ]*}} 'short' sugar
+// CHECK-NEXT: TemplateTypeParmType 0x{{[^ ]*}} 'U' dependent contains_unexpanded_pack depth 0 index 0 pack
+} // namespace PR56099


        


More information about the cfe-commits mailing list