diff options
author | Joseph Myers <jsm@polyomino.org.uk> | 2004-09-17 19:18:05 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2004-09-17 19:18:05 +0100 |
commit | 98c3a782774396163f6bcacf91515131e3abe375 (patch) | |
tree | 065e742552e8a8e99595de375f55074a900b5eb3 /gcc/c-tree.h | |
parent | 254ea84c129481587eae80d78783b08d8d6cd507 (diff) | |
download | gcc-98c3a782774396163f6bcacf91515131e3abe375.zip gcc-98c3a782774396163f6bcacf91515131e3abe375.tar.gz gcc-98c3a782774396163f6bcacf91515131e3abe375.tar.bz2 |
c-tree.h (enum c_typespec_keyword): New.
* c-tree.h (enum c_typespec_keyword): New.
(struct c_declspecs): Adjust description of "type". Remove
specbits, explicit_int_p and explicit_char_p. Rename
typedef_signed_p to explicit_signed_p. Add default_int_p, long_p,
short_p, signed_p, unsigned_p and complex_p.
(finish_declspecs): New.
* c-parse.in (datadef, datadecl, setspecs, decl, component_decl,
typename): Call finish_declspecs.
* c-decl.c (finish_declspecs): New.
(declspecs_add_type): Check for combinations which cannot occur in
valid specifier lists. Update comments.
(shadow_tag_warned): Remove checks done in finish_declspecs.
Don't report useless type name if type defaulted to int.
(grokdeclarator): Remove checks and actions done in
finish_declspecs. Don't allow for type being NULL. Update for
datastructures changes. Initialize decl_attr.
(build_null_declspecs, quals_from_declspecs): Update for
datastructures changes.
testsuite:
* gcc.dg/declspec-4.c, gcc.dg/declspec-5.c, gcc.dg/declspec-6.c:
Update expected messages.
* gcc.dg/declspec-13.c: New test.
From-SVN: r87660
Diffstat (limited to 'gcc/c-tree.h')
-rw-r--r-- | gcc/c-tree.h | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 5d1ec30..76981a7 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -141,10 +141,24 @@ enum c_storage_class { csc_typedef }; +/* A type specifier keyword "void", "_Bool", "char", "int", "float", + "double", or none of these. */ +enum c_typespec_keyword { + cts_none, + cts_void, + cts_bool, + cts_char, + cts_int, + cts_float, + cts_double +}; + /* A sequence of declaration specifiers in C. */ struct c_declspecs { - /* The type specified, not reflecting modifiers such as "short" and - "unsigned", or NULL_TREE if none. */ + /* The type specified, if a single type specifier such as a struct, + union or enum specifier, typedef name or typeof specifies the + whole type, or NULL_TREE if none or a keyword such as "void" or + "char" is used. Does not include qualifiers. */ tree type; /* The attributes from a typedef decl. */ tree decl_attr; @@ -152,8 +166,9 @@ struct c_declspecs { NULL; attributes (possibly from multiple lists) will be passed separately. */ tree attrs; - /* The modifier bits present. */ - int specbits; + /* Any type specifier keyword used such as "int", not reflecting + modifiers such as "short", or cts_none if none. */ + enum c_typespec_keyword typespec_word; /* The storage class specifier, or csc_none if none. */ enum c_storage_class storage_class; /* Whether something other than a storage class specifier or @@ -165,17 +180,26 @@ struct c_declspecs { BOOL_BITFIELD non_sc_seen_p : 1; /* Whether the type is specified by a typedef. */ BOOL_BITFIELD typedef_p : 1; - /* Whether the type is specified by a typedef whose type is - explicitly "signed". */ - BOOL_BITFIELD typedef_signed_p : 1; + /* Whether the type is explicitly "signed" or specified by a typedef + whose type is explicitly "signed". */ + BOOL_BITFIELD explicit_signed_p : 1; /* Whether the specifiers include a deprecated typedef. */ BOOL_BITFIELD deprecated_p : 1; - /* Whether "int" was explicitly specified. */ - BOOL_BITFIELD explicit_int_p : 1; - /* Whether "char" was explicitly specified. */ - BOOL_BITFIELD explicit_char_p : 1; + /* Whether the type defaulted to "int" because there were no type + specifiers. */ + BOOL_BITFIELD default_int_p; + /* Whether "long" was specified. */ + BOOL_BITFIELD long_p : 1; /* Whether "long" was specified more than once. */ BOOL_BITFIELD long_long_p : 1; + /* Whether "short" was specified. */ + BOOL_BITFIELD short_p : 1; + /* Whether "signed" was specified. */ + BOOL_BITFIELD signed_p : 1; + /* Whether "unsigned" was specified. */ + BOOL_BITFIELD unsigned_p : 1; + /* Whether "complex" was specified. */ + BOOL_BITFIELD complex_p : 1; /* Whether "inline" was specified. */ BOOL_BITFIELD inline_p : 1; /* Whether "__thread" was specified. */ @@ -362,6 +386,7 @@ extern struct c_declspecs *declspecs_add_qual (struct c_declspecs *, tree); extern struct c_declspecs *declspecs_add_type (struct c_declspecs *, tree); extern struct c_declspecs *declspecs_add_scspec (struct c_declspecs *, tree); extern struct c_declspecs *declspecs_add_attrs (struct c_declspecs *, tree); +extern struct c_declspecs *finish_declspecs (struct c_declspecs *); /* in c-objc-common.c */ extern int c_disregard_inline_limits (tree); |