[clang] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 25 18:14:51 PDT 2023


================
@@ -171,3 +171,12 @@ namespace CtorTemplateBeatsNonTemplateConversionFn {
   Foo f(Derived d) { return d; } // expected-error {{invokes a deleted function}}
   Foo g(Derived d) { return Foo(d); } // ok, calls constructor
 }
+
+namespace GH65522 {
+template<typename A3>
+class B3 : A3 {
+  template<bool = C3<B3>()> // expected-warning 2{{use of function template name with no prior declaration in function call with explicit}}
+  B3();
+}; B3(); // expected-error {{deduction guide declaration without trailing return type}} \
+         // expected-note {{while building deduction guide here}}
----------------
zygoloid wrote:

https://godbolt.org/z/fKjTzfG6v is the best I've found so far.

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


More information about the cfe-commits mailing list