[clang] [clang] Fix crash when declaring invalid lambda member (PR #74110)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 15 07:37:18 PST 2024


================
@@ -624,22 +626,22 @@ namespace ConversionOperatorDoesNotHaveDeducedReturnType {
     template<typename T>
       friend constexpr U::operator ExpectedTypeU<T>() const noexcept;
 #else
-    friend auto T::operator()(int) const;
+    friend auto T::operator()(int) const; // cxx11-error {{'auto' return without trailing return type; deduced return types are a C++14 extension}}
     friend T::operator ExpectedTypeT() const;
 
     template<typename T>
-      friend void U::operator()(T&) const;
+      friend void U::operator()(T&) const; // cxx11-error {{friend declaration of 'operator()' does not match any declaration}}
     // FIXME: This should not match, as above.
     template<typename T>
-      friend U::operator ExpectedTypeU<T>() const;
+      friend U::operator ExpectedTypeU<T>() const; // cxx11-error {{friend declaration of 'operator void (*)(type-parameter-0-0 &)' does not match any declaration}}
----------------
AaronBallman wrote:

Oof, that's a bit of a gross diagnostic (not the fault of your patch).

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


More information about the cfe-commits mailing list