summaryrefslogtreecommitdiff
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-30 13:33:17 +0000
committerreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-30 13:33:17 +0000
commit8a98ec4af085fc3a734166d42e45acd0c84d9b91 (patch)
treee7c9695a52b0a71525c8ba2bc639cee7578958bc /gcc/c-typeck.c
parentdf71b940580bce9853600f078093d225fc4f9c02 (diff)
downloadgcc-8a98ec4af085fc3a734166d42e45acd0c84d9b91.tar.gz
PR c/27718
* c-typeck.c (c_expr_sizeof_type): Handle invalid types. * gcc.dg/sizeof-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114234 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 7a8cdc40e23..2c5736cf769 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -2153,7 +2153,8 @@ c_expr_sizeof_type (struct c_type_name *t)
type = groktypename (t);
ret.value = c_sizeof (type);
ret.original_code = ERROR_MARK;
- pop_maybe_used (C_TYPE_VARIABLE_SIZE (type));
+ pop_maybe_used (type != error_mark_node
+ ? C_TYPE_VARIABLE_SIZE (type) : false);
return ret;
}