[clang] [SemaCXX] Fixed defaulted equality operator deletion issue (#97087)[SemaCXX] Fix defaulted equality operator being incorrectly deleted when using namespace (llvm#97087) (PR #166996)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 19 18:55:05 PST 2025


================
@@ -8913,6 +8915,9 @@ bool Sema::CheckExplicitlyDefaultedComparison(Scope *S, FunctionDecl *FD,
 
   // Perform any unqualified lookups we're going to need to default this
   // function.
+  if (!S)
----------------
shafik wrote:

Based on @zygoloid comment:

https://github.com/llvm/llvm-project/issues/97087#issuecomment-2207341010

here it looks like the fix is the pass Scope instead of `nullptr` here:

https://github.com/llvm/llvm-project/blob/4c63672ca706c708de1e49bb29d026a705daa0d2/clang/lib/Sema/SemaDeclCXX.cpp#L17990

Did you try this?

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


More information about the cfe-commits mailing list