PR c++ 5373.
* g++.dg/parse/stmtexpr1.C: New test.
PR c++/5373.
* semantics.c (finish_expr_stmt): Remember the type of the
expression before any conversions are performed.
From-SVN: r52264
2002-04-12 Mark Mitchell <mark@codesourcery.com>
+ PR c++/5373.
+ * semantics.c (finish_expr_stmt): Remember the type of the
+ expression before any conversions are performed.
+
+2002-04-12 Mark Mitchell <mark@codesourcery.com>
+
PR c++/5189.
* call.c (add_template_candidate_real): Do not treat member
templates as copy constructors.
tree expr;
{
tree r = NULL_TREE;
+ tree expr_type = NULL_TREE;;
if (expr != NULL_TREE)
{
|| TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE))
expr = default_conversion (expr);
+ /* Remember the type of the expression. */
+ expr_type = TREE_TYPE (expr);
+
if (stmts_are_full_exprs_p ())
expr = convert_to_void (expr, "statement");
/* This was an expression-statement, so we save the type of the
expression. */
- last_expr_type = expr ? TREE_TYPE (expr) : NULL_TREE;
+ last_expr_type = expr_type;
return r;
}
2002-04-12 Mark Mitchell <mark@codesourcery.com>
+ PR c++ 5373.
+ * g++.dg/parse/stmtexpr1.C: New test.
+
PR c++/5189.
- * call.c (add_template_candidate_real): Do not treat member
- templates as copy constructors.
+ * g++.dg/template/copy1.C: New test.
2002-04-12 Richard Henderson <rth@redhat.com>
--- /dev/null
+// { dg-do compile }
+// { dg-options "" }
+
+int
+main (int argc, char **argv)
+{
+ int a = ({ 1 ? 0 : 1; });
+ return ({ argc > 1 ? 1 : 0; });
+}