parser.c (cp_parser_sizeof_operand): Do not evaluate the expression.
authorMark Mitchell <mark@codesourcery.com>
Thu, 2 Jan 2003 18:12:28 +0000 (18:12 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 2 Jan 2003 18:12:28 +0000 (18:12 +0000)
* parser.c (cp_parser_sizeof_operand): Do not evaluate the
expression.

From-SVN: r60791

gcc/cp/ChangeLog
gcc/cp/parser.c

index aa220ef7fa828c3a2fd015f38200cdb9059781c7..f52697b128f0b908e1e36192fbc5dc671375ff6a 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-02  Mark Mitchell  <mark@codesourcery.com>
+
+       * parser.c (cp_parser_sizeof_operand): Do not evaluate the
+       expression.
+
 2003-01-02  Steven Bosscher <s.bosscher@student.tudelft.nl>
 
        * cp/except.c, cp/expr.c, cp/friend.c, cp/g++spec.c,
index 32d2f8493bc42cd814e783f304a4120d3bd8bc41..7532116977ceeeb072bd1451dd522b31e0da589a 100644 (file)
@@ -1,5 +1,5 @@
 /* C++ Parser.
-   Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    Written by Mark Mitchell <mark@codesourcery.com>.
 
    This file is part of GCC.
@@ -14432,6 +14432,8 @@ cp_parser_sizeof_operand (parser, keyword)
   saved_constant_expression_p = parser->constant_expression_p;
   parser->constant_expression_p = false;
 
+  /* Do not actually evaluate the expression.  */
+  ++skip_evaluation;
   /* If it's a `(', then we might be looking at the type-id
      construction.  */
   if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_PAREN))
@@ -14468,6 +14470,8 @@ cp_parser_sizeof_operand (parser, keyword)
      looking at the unary-expression production.  */
   if (!expr)
     expr = cp_parser_unary_expression (parser, /*address_p=*/false);
+  /* Go back to evaluating expressions.  */
+  --skip_evaluation;
 
   /* Free the message we created.  */
   free ((char *) parser->type_definition_forbidden_message);