diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-15 21:16:23 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-15 21:16:23 +0000 |
commit | 93894129325de7967311711c445aff36dd64bb86 (patch) | |
tree | be917cdfeaeec953b25fe411d7db833f292e9f3a /gcc/c-parse.in | |
parent | 54a7d407ca00dfb8484d45abbafdfbd46202127e (diff) | |
download | gcc-93894129325de7967311711c445aff36dd64bb86.tar.gz |
* c-tree.h (skip_evaluation): Move declaration...
* c-common.h: ... here.
* c-typeck.c (build_external_ref): Don't assemble_external nor
mark a tree as used if skip_evaluation is set.
* c-parse.in (typeof): New non-terminal to set skip_evaluation
around TYPEOF.
(typespec_nonreserved_nonattr): Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56358 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parse.in')
-rw-r--r-- | gcc/c-parse.in | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 11e0e442cc2..eab176a62f7 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -562,6 +562,10 @@ alignof: ALIGNOF { skip_evaluation++; } ; +typeof: + TYPEOF { skip_evaluation++; } + ; + cast_expr: unary_expr | '(' typename ')' cast_expr %prec UNARY @@ -1394,10 +1398,10 @@ ifobjc | non_empty_protocolrefs { $$ = get_object_reference ($1); } end ifobjc - | TYPEOF '(' expr ')' - { $$ = TREE_TYPE ($3); } - | TYPEOF '(' typename ')' - { $$ = groktypename ($3); } + | typeof '(' expr ')' + { skip_evaluation--; $$ = TREE_TYPE ($3); } + | typeof '(' typename ')' + { skip_evaluation--; $$ = groktypename ($3); } ; /* typespec_nonreserved_attr does not exist. */ |