[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 19 06:39:58 PDT 2024
================
@@ -7525,6 +7525,8 @@ def err_explicit_object_parameter_mutable: Error<
def err_invalid_explicit_object_type_in_lambda: Error<
"invalid explicit object parameter type %0 in lambda with capture; "
"the type must be the same as, or derived from, the lambda">;
+def err_explicit_object_parameter_invalid: Error<
+ "an explicit object parameter is not allowed here">;
----------------
Sirraide wrote:
I’ve changed it to ‘an explicit object parameter can only appear as the first parameter of a member function’; while still not great, it at least gives some more indication as to what the problem is. I’m not sure how easy/helpful it would be to give more detailed diagnostics for cases such as
```c++
struct S {
int (S::*x)(this int);
int h(int x, int (*)(this S))
};
```
https://github.com/llvm/llvm-project/pull/89078
More information about the cfe-commits
mailing list