summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-02 18:12:28 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-02 18:12:28 +0000
commit4c99a080080ad301b3d5ffdf0ac9a78eb44e996e (patch)
treee3ac28ac91d298152bf4daf783c2bc06125ef78c
parent9964a524358ba0b8f8732b6ee781df16a246f4f8 (diff)
downloadppe42-gcc-4c99a080080ad301b3d5ffdf0ac9a78eb44e996e.tar.gz
ppe42-gcc-4c99a080080ad301b3d5ffdf0ac9a78eb44e996e.zip
* parser.c (cp_parser_sizeof_operand): Do not evaluate the
expression. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60791 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index aa220ef7fa8..f52697b128f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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,
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 32d2f8493bc..7532116977c 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -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);
OpenPOWER on IntegriCloud