[PATCH] D60349: [COFF, ARM64] Fix ABI implementation of struct returns

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 25 12:32:37 PDT 2019

efriedma added inline comments.

Comment at: lib/CodeGen/MicrosoftCXXABI.cpp:1074
+  if (!RD->hasTrivialCopyAssignment())
+    return true;
+  return false;
richard.townsend.arm wrote:
> richard.townsend.arm wrote:
> > Should this function also check for user-provided constructors?
> I think it should: I speculatively added these two lines
>   if (RD->hasUserDeclaredConstructor())
>     return true;
> and it resolved the problem with `std::setw` I mentioned in the bug tracker (which means Electron could start). 
The comment says it's supposed to check for user-provided constructors, but there isn't any code to perform that check, yes.

hasUserDeclaredConstructor() isn't precisely correct; from the C++ standard, "A function is user-provided if it is user-declared and not explicitly defaulted or deleted on its first declaration."



More information about the cfe-commits mailing list