summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-23 14:50:27 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-23 14:50:27 +0000
commitf63e4c3334eb46e5f2080b2acc7e09b42b70b2b8 (patch)
tree28e80f409726e7542f909e883668f7b9f5e784aa /clang/lib/CodeGen/CGExprScalar.cpp
parent6181a75d497edec3c31ed466f63e5df0a5c143f1 (diff)
downloadbcm5719-llvm-f63e4c3334eb46e5f2080b2acc7e09b42b70b2b8.tar.gz
bcm5719-llvm-f63e4c3334eb46e5f2080b2acc7e09b42b70b2b8.zip
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! llvm-svn: 111809
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index 4487f17f604..49deb7b365a 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/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");
OpenPOWER on IntegriCloud