forked from OSchip/llvm-project
parent
e1314a64b8
commit
357b6fd3e5
|
@ -579,10 +579,14 @@ CodeGenFunction::EmitCXXConstructExpr(llvm::Value *Dest,
|
|||
const Expr *Arg = E->getArg(0);
|
||||
|
||||
if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(Arg)) {
|
||||
if (isa<CXXBindTemporaryExpr>(ICE->getSubExpr()))
|
||||
Arg = cast<CXXBindTemporaryExpr>(ICE->getSubExpr())->getSubExpr();
|
||||
} else if (const CXXBindTemporaryExpr *BindExpr =
|
||||
dyn_cast<CXXBindTemporaryExpr>(Arg))
|
||||
assert((ICE->getCastKind() == CastExpr::CK_NoOp ||
|
||||
ICE->getCastKind() == CastExpr::CK_ConstructorConversion) &&
|
||||
"Unknown implicit cast kind in constructor elision");
|
||||
Arg = ICE->getSubExpr();
|
||||
}
|
||||
|
||||
if (const CXXBindTemporaryExpr *BindExpr =
|
||||
dyn_cast<CXXBindTemporaryExpr>(Arg))
|
||||
Arg = BindExpr->getSubExpr();
|
||||
|
||||
EmitAggExpr(Arg, Dest, false);
|
||||
|
|
Loading…
Reference in New Issue