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 | f63e4c3334eb46e5f2080b2acc7e09b42b70b2b8 (patch) | |
tree | 28e80f409726e7542f909e883668f7b9f5e784aa /clang/lib/CodeGen/CGExprScalar.cpp | |
parent | 6181a75d497edec3c31ed466f63e5df0a5c143f1 (diff) | |
download | bcm5719-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.cpp | 7 |
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"); |