[clang] [clang] [C++20] Defaulted operator== doesn't lookup in using-directive properly #97087 (PR #99542)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 23 01:47:22 PDT 2024


================
@@ -124,7 +124,7 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(
                       ? diag::warn_cxx98_compat_defaulted_deleted_function
                       : diag::ext_defaulted_deleted_function)
         << 0 /* defaulted */;
-      Actions.SetDeclDefaulted(FnD, KWLoc);
+      Actions.SetDeclDefaulted(nullptr, FnD, KWLoc);
----------------
cor3ntin wrote:

```suggestion
      Actions.SetDeclDefaulted(/*Scope=*/nullptr, FnD, KWLoc);
```

Ditto everywhere you pass a nullptr.

Alternatively, declare `SetDeclDefaulted` as

``void SetDeclDefaulted(Decl *dcl, SourceLocation DefaultLoc, Scope *S = nullptr);`

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


More information about the cfe-commits mailing list