diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-03 03:01:57 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-03 03:01:57 +0000 |
commit | 321725d95d331d1612ac386d7d4235eca94b0021 (patch) | |
tree | 653a8ef4b3ee3a9f92dc089dcd248ed09ef09007 /lib/CodeGen/CGExprCXX.cpp | |
parent | b0e4cb6a88a4b4bd2ecdcc622e852fa3e20290c9 (diff) |
Provide a real fix for PR6199, reverting the old workaround. Here, we
realize that CXXConstructExpr is always implicit, so we should just
return its argument (if there is only one) rather than directly
invoking the constructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95192 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGExprCXX.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index 8dd747240a..4253d18c39 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/lib/CodeGen/CGExprCXX.cpp @@ -309,9 +309,7 @@ CodeGenFunction::EmitCXXConstructExpr(llvm::Value *Dest, if (getContext().getLangOptions().ElideConstructors && E->isElidable()) { const Expr *Arg = E->getArg(0); - // FIXME: This 'while' statement should really be an 'if' statement, it's - // added as a workaround for PR6199. - while (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(Arg)) { + if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(Arg)) { assert((ICE->getCastKind() == CastExpr::CK_NoOp || ICE->getCastKind() == CastExpr::CK_ConstructorConversion || ICE->getCastKind() == CastExpr::CK_UserDefinedConversion) && |