diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-23 14:50:27 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-23 14:50:27 +0000 |
commit | 5d743fa747281dbecbc0d557035ca44f8a26a342 (patch) | |
tree | 3d77e4f51af3b66e8201a343533ad6f400c10429 /lib/CodeGen/CGExprScalar.cpp | |
parent | 11add9b2e915e5da4a9da25a89e3fb0a4b7f0173 (diff) |
Emit an error noting that Clang does not support code generation for
the ternary operator without a left-hand side in C++ (PR7726), from
Jean-Daniel Dupas!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 4487f17f60..49deb7b365 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -2058,7 +2058,12 @@ VisitConditionalOperator(const ConditionalOperator *E) { return Builder.CreateSelect(CondV, LHS, RHS, "cond"); } - + if (!E->getLHS() && CGF.getContext().getLangOptions().CPlusPlus) { + // Does not support GNU missing condition extension in C++ yet (see #7726) + CGF.ErrorUnsupported(E, "conditional operator with missing LHS"); + return llvm::UndefValue::get(ConvertType(E->getType())); + } + llvm::BasicBlock *LHSBlock = CGF.createBasicBlock("cond.true"); llvm::BasicBlock *RHSBlock = CGF.createBasicBlock("cond.false"); llvm::BasicBlock *ContBlock = CGF.createBasicBlock("cond.end"); |