+2002-10-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/6579
+ * spew.c (snarf_parenthesized_expression): New function.
+ (snarf_block): Use it.
+
2002-10-22 Richard Henderson <rth@redhat.com>
* method.c (use_thunk): Always compute vcall_value; assert that
static void snarf_block PARAMS ((struct unparsed_text *t));
static tree snarf_defarg PARAMS ((void));
+static void snarf_parenthesized_expression (struct unparsed_text *);
static int frob_id PARAMS ((int, int, tree *));
/* The list of inline functions being held off until we reach the end of
return r;
}
+/* Accumulate the tokens that make up a parenthesized expression in T,
+ having already read the opening parenthesis. */
+
+static void
+snarf_parenthesized_expression (struct unparsed_text *t)
+{
+ int yyc;
+ int level = 1;
+
+ while (1)
+ {
+ yyc = next_token (space_for_token (t));
+ if (yyc == '(')
+ ++level;
+ else if (yyc == ')' && --level == 0)
+ break;
+ else if (yyc == 0)
+ {
+ error ("%Hend of file read inside definition", &t->locus);
+ break;
+ }
+ }
+}
+
/* Subroutine of snarf_method, deals with actual absorption of the block. */
static void
else if (look_for_semicolon && blev == 0)
break;
}
+ else if (yyc == '(' && blev == 0)
+ snarf_parenthesized_expression (t);
else if (yyc == 0)
{
error ("%Hend of file read inside definition", &t->locus);
+2002-10-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/6579
+ * g++.dg/parse/stmtexpr3.C: New test.
+
2002-10-22 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/expr/cond1.C: New test.