[cfe-commits] r111809 - /cfe/trunk/lib/CodeGen/CGExprScalar.cpp
Douglas Gregor
dgregor at apple.com
Mon Aug 23 07:50:27 PDT 2010
Author: dgregor
Date: Mon Aug 23 09:50:27 2010
New Revision: 111809
URL: http://llvm.org/viewvc/llvm-project?rev=111809&view=rev
Log:
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!
Modified:
cfe/trunk/lib/CodeGen/CGExprScalar.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=111809&r1=111808&r2=111809&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Mon Aug 23 09:50:27 2010
@@ -2058,7 +2058,12 @@
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");
More information about the cfe-commits
mailing list