[clang] [clang] Fix a crash when default argument is passed to an explicit object parameter (PR #177534)
Corentin Jabot via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 22 23:03:52 PST 2026
================
@@ -1400,3 +1400,18 @@ a void Bar(this int) { // expected-note {{candidate function}}
}
}
+
+namespace GH176639 {
+
+struct S {
+ void operator()(this S =) // expected-error {{the explicit object parameter cannot have a default argument}}
+ // expected-error at -1 {{expected ';' at end of declaration list}}
+ // expected-error at -2 {{expected expression}}
+};
----------------
cor3ntin wrote:
Did you test `this S = S {}`? or should the title say "Fix a crash when an invalid default argument is passed to an explicit object parameter" ?
https://github.com/llvm/llvm-project/pull/177534
More information about the cfe-commits
mailing list