[clang] Fix crash with invalid member function param list (PR #139595)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Mon May 12 11:20:58 PDT 2025
================
@@ -40,3 +40,13 @@ struct S : public Base1<int>, public Base2<float> {
// All initializers are correct, nothing to skip, diagnose 2 missing commas.
S(const S &) : Base1<int>(0) ::Base2<float>(1.0) x(2) {} // expected-error2{{missing ',' between base or member initializers}}
};
+
+namespace GH113722 {
+struct S {
+ void m(int x = 0; // expected-error {{unexpected end of default argument expression}} \
+ expected-note {{to match this '('}}
+ #pragma unused(x) // expected-error {{expected ')'}} \
----------------
erichkeane wrote:
OH! missed that this was a function parameter/default argument and part of one that is already ill-formed. I thinks this recovery makes sense, I don't see any need for other tests
https://github.com/llvm/llvm-project/pull/139595
More information about the cfe-commits
mailing list