[clang] Fix crash on template-specialization (PR #142338)

Mark de Wever via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 2 00:02:21 PDT 2025


================
@@ -160,7 +160,7 @@ template<typename T> struct X;
 
 // Make sure that the instantiated constructor initializes start and
 // end properly.
-// CHECK-LABEL: define linkonce_odr void @_ZN1XIiEC2ERKS0_(ptr {{[^,]*}} %this, ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %other) unnamed_addr
+// CHECK-LABEL: define linkonce_odr void @_ZN1XIiEC2ERKS0_(ptr {{[^,]*}} %this, ptr noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) %0) unnamed_addr
----------------
mark-de-wever-sonarsource wrote:

The restoration of the name changes the param name in the AST and causes this test to fail.
It seems possible to avoid it, but I'm not sure the current solution is bad on the case for the default argument.

There seem to be no AST tests that validate this requirement.

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


More information about the cfe-commits mailing list