[clang] [Clang] _default-movable_ should be based on the first declaration (PR #143661)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 11 00:51:02 PDT 2025


================
@@ -121,8 +121,10 @@ static bool hasSuitableConstructorForRelocation(Sema &SemaRef,
 
   CXXMethodDecl *Decl =
       LookupSpecialMemberFromXValue(SemaRef, D, /*Assign=*/false);
----------------
ojhunt wrote:

Is it reasonable to have LookupSpecialMemberFromXValue simply return the canonical declaration? Rather than every call site needing to remember that some Sema checks will require canonicalization?

It looks like you're having to perform canonicalization in 4 of the 6 calls to it, and I'm not sure why not in the remaining two? It seems like they're intended just for diagnostics, but it seems any diagnostic would need to be about the canonical decl as well?

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


More information about the cfe-commits mailing list