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

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 09:23:33 PDT 2024


================
@@ -4845,6 +4845,61 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
       // Check for auto functions and trailing return type and adjust the
       // return type accordingly.
       if (!D.isInvalidType()) {
+        auto IsClassType = [&](CXXScopeSpec &SS) {
+          // If there already was an problem with the scope, don’t issue another
+          // error about the explicit object parameter.
+          return SS.isInvalid() ||
+                 isa_and_present<CXXRecordDecl>(S.computeDeclContext(SS));
+        };
+
+        // [dcl.fct]p6:
----------------
cor3ntin wrote:

```suggestion
        // C++23 [dcl.fct]p6:
```

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


More information about the cfe-commits mailing list