[clang] [clang] CTAD: fix the aggregate deduction guide for alias templates. (PR #90894)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 02:31:48 PDT 2024


================
@@ -261,6 +261,13 @@ AG ag = {1};
 // CHECK:   | `-BuiltinType {{.*}} 'int'
 // CHECK:   `-ParmVarDecl {{.*}} 'int'
 
+template <typename X = int>
+using BG = G<int>;
+BG bg(1.0);
+// CHECK-LABEL: Dumping <deduction guide for BG>
+// CHECK:      FunctionTemplateDecl {{.*}} implicit <deduction guide for BG>
+// CHECK: |-CXXDeductionGuideDecl {{.*}} 'auto (int) -> G<int>' aggregate
----------------
mizvekov wrote:

The line is a CHECK, not a CHECK-NEXT, so it could appear any number of lines afterwards.
So this means it could be a child of something else that appears after it.

The CHECK matcher matches any number of characters before the first character specified,
So it would match something like `| | |-CXXDeductionGuideDecl {{.*}} 'auto (int) -> G<int>' aggregate`
Ie, it could be deeply nested into something else.

Instead, I think it just demonstrates:
* It is a child of something.
* It's neither the first nor the last child of that thing.

https://github.com/llvm/llvm-project/pull/90894


More information about the cfe-commits mailing list