[PATCH] D109800: [clang] don't mark as Elidable CXXConstruct expressions used in NRVO
Arthur O'Dwyer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 16 10:33:03 PDT 2021
Quuxplusone added a comment.
FWIW, this is almost entirely above my pay grade. Getting rid of that extra bool parameter throughout //looks// awesome, though. :)
I do think it might be a good idea to include one or two tests that actually run all the way through codegen, e.g. https://godbolt.org/z/54eTrj54M
The scary failure mode here (if you are like me and don't really understand why this is impossible ;)) would be if the compiler somehow elided one of the implicit conversions without eliding the other one (like how compiler bugs have in the past led to eliding a constructor without eliding the matching destructor).
Also, is it worth testing anything in constexpr functions? My understanding is that constexpr functions never do copy elision, although maybe(?) they're permitted to?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109800/new/
https://reviews.llvm.org/D109800
More information about the cfe-commits
mailing list