[PATCH] D109800: [clang] don't mark as Elidable CXXConstruct expressions used in NRVO
Dimitry Andric via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Sep 19 10:22:13 PDT 2021
dim added inline comments.
================
Comment at: clang/lib/AST/ExprConstant.cpp:9937
+ if (E->isElidable() && !ZeroInit) {
+ // FIXME: This only handles the simples case, where the source object
+ // is passed directly as the first argument to the constructor.
----------------
`s/simples/simplest/`
================
Comment at: clang/lib/CodeGen/CGExprCXX.cpp:613
if (getLangOpts().ElideConstructors && E->isElidable()) {
- assert(getContext().hasSameUnqualifiedType(E->getType(),
- E->getArg(0)->getType()));
- if (E->getArg(0)->isTemporaryObject(getContext(), CD->getParent())) {
- EmitAggExpr(E->getArg(0), Dest);
- return;
- }
+ // FIXME: This only handles the simples case, where the source object
+ // is passed directly as the first argument to the constructor.
----------------
`s/simples/simplest/`
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