+2004-02-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/14083
+ * call.c (build_conditional_expr): Call force_rvalue on the
+ non-void operand in the case that one result is a throw-expression
+ and the other is not.
+
2004-02-13 Ian Lance Taylor <ian@wasabisystems.com>
PR c++/9851
--Both the second and the third operands have type void; the
result is of type void and is an rvalue. */
- if ((TREE_CODE (arg2) == THROW_EXPR)
- ^ (TREE_CODE (arg3) == THROW_EXPR))
- result_type = ((TREE_CODE (arg2) == THROW_EXPR)
- ? arg3_type : arg2_type);
+ if (TREE_CODE (arg2) == THROW_EXPR
+ && TREE_CODE (arg3) != THROW_EXPR)
+ {
+ arg3 = force_rvalue (arg3);
+ arg3_type = TREE_TYPE (arg3);
+ result_type = arg3_type;
+ }
+ else if (TREE_CODE (arg2) != THROW_EXPR
+ && TREE_CODE (arg3) == THROW_EXPR)
+ {
+ arg2 = force_rvalue (arg2);
+ arg2_type = TREE_TYPE (arg2);
+ result_type = arg2_type;
+ }
else if (VOID_TYPE_P (arg2_type) && VOID_TYPE_P (arg3_type))
result_type = void_type_node;
else
+2004-02-13 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/14083
+ * g++.dg/eh/cond2.C: New test.
+
2004-02-12 Alan Modra <amodra@bigpond.net.au>
* gcc.dg/debug/20020327-1.c: Disable for powerpc64.
--- /dev/null
+// PR c++/14083
+
+struct A {
+ A() throw() { }
+ A(const A&) throw() { }
+};
+
+struct X {
+ A a;
+ X();
+ X& operator=(const X& __str);
+};
+
+bool operator==(const X& __lhs, const char* __rhs);
+
+int main() {
+ X x;
+ x=="" ? x : throw 1;
+}