aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-tree.h
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2010-11-13 09:52:00 +0000
committerPaolo Bonzini <bonzini@gcc.gnu.org>2010-11-13 09:52:00 +0000
commit9e5b21156632fd14bfaeea24919c614e56645989 (patch)
treeeb7240972890ab86d11f88bf6522ea66910f938f /gcc/c-tree.h
parent18406601136a40c875005c3f11563f657fc1f0ca (diff)
downloadgcc-9e5b21156632fd14bfaeea24919c614e56645989.zip
gcc-9e5b21156632fd14bfaeea24919c614e56645989.tar.gz
gcc-9e5b21156632fd14bfaeea24919c614e56645989.tar.bz2
c-tree.h (enum c_typespec_kind): Add ctsk_none.
2010-11-13 Paolo Bonzini <bonzini@gnu.org> * c-tree.h (enum c_typespec_kind): Add ctsk_none. (struct c_declspecs): Replace tagdef_seen_p and type_seen_p with typespec_kind. * c-decl.c (build_null_declspecs): Initialize typespec_kind. (shadow_tag_warned, check_compound_literal_type): Adjust uses of tag_defined_p. (declspecs_add_type): Set typespec_kind. * c-parser.c (c_parser_declaration_or_fndef, c_parser_declspecs, c_parser_struct_declaration, c_parser_parameter_declaration, c_parser_type_name, c_parser_objc_diagnose_bad_element_prefix): Adjust uses of type_seen_p. * c-typeck.c (c_cast_expr): Use typespec_kind instead of tag_defined_p, pass ctsk_firstref through. testsuite: 2010-11-13 Paolo Bonzini <bonzini@gnu.org> * gcc.dg/Wcxx-compat-8.c: Add testcases involving incomplete types. From-SVN: r166699
Diffstat (limited to 'gcc/c-tree.h')
-rw-r--r--gcc/c-tree.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 0d94ceb..0581b38 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -134,6 +134,8 @@ struct c_expr
only used to distinguish tag definitions, tag references and typeof
uses. */
enum c_typespec_kind {
+ /* No typespec. This appears only in struct c_declspec. */
+ ctsk_none,
/* A reserved keyword type specifier. */
ctsk_resword,
/* A reference to a tag, previously declared, such as "struct foo".
@@ -225,13 +227,14 @@ struct c_declspecs {
/* Any type specifier keyword used such as "int", not reflecting
modifiers such as "short", or cts_none if none. */
ENUM_BITFIELD (c_typespec_keyword) typespec_word : 8;
+ /* The kind of type specifier if one has been seen, ctsk_none
+ otherwise. */
+ ENUM_BITFIELD (c_typespec_kind) typespec_kind : 3;
/* Whether any expressions in typeof specifiers may appear in
constant expressions. */
BOOL_BITFIELD expr_const_operands : 1;
/* Whether any declaration specifiers have been seen at all. */
BOOL_BITFIELD declspecs_seen_p : 1;
- /* Whether a type specifier has been seen. */
- BOOL_BITFIELD type_seen_p : 1;
/* Whether something other than a storage class specifier or
attribute has been seen. This is used to warn for the
obsolescent usage of storage class specifiers other than at the
@@ -241,10 +244,6 @@ struct c_declspecs {
BOOL_BITFIELD non_sc_seen_p : 1;
/* Whether the type is specified by a typedef or typeof name. */
BOOL_BITFIELD typedef_p : 1;
- /* Whether a struct, union or enum type either had its content
- defined by a type specifier in the list or was the first visible
- declaration of its tag. */
- BOOL_BITFIELD tag_defined_p : 1;
/* Whether the type is explicitly "signed" or specified by a typedef
whose type is explicitly "signed". */
BOOL_BITFIELD explicit_signed_p : 1;