CGF.EmitBlock(ContBlock);
- if (!LHS || !RHS) {
- assert(E->getType()->isVoidType() && "Non-void value should have a value");
- return 0;
- }
+ // If the LHS or RHS is a throw expression, it will be legitimately null.
+ if (!LHS)
+ return RHS;
+ if (!RHS)
+ return LHS;
// Create a PHI node for the real part.
llvm::PHINode *PN = Builder.CreatePHI(LHS->getType(), "cond");
--- /dev/null
+// RUN: clang-cc -emit-llvm-only -verify %s
+
+int val = 42;
+int& test1() {
+ return throw val, val;
+}
+
+int test2() {
+ return val ? throw val : val;
+}