[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 07:40:28 PDT 2024


================
@@ -5,7 +5,7 @@
 void f(this); // expected-error{{variable has incomplete type 'void'}} \
               // expected-error{{invalid use of 'this' outside of a non-static member function}}
 
-void g(this auto); // expected-error{{an explicit object parameter cannot appear in a non-member function}}
+void g(this auto); // expected-error{{an explicit object parameter is not allowed here}}
----------------
cor3ntin wrote:

I would rather keep the older diagnostic, which is more help. I'd recommend using %select. there are 2 cases

- In a non-member function
- In the declaration of a function pointer type

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


More information about the cfe-commits mailing list