diff options
author | Joseph Myers <jsm@polyomino.org.uk> | 2004-09-14 19:59:38 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2004-09-14 19:59:38 +0100 |
commit | 3b53cddc38abb716ac6b300d68cfe841a3a4f265 (patch) | |
tree | fb8bf0df6ee54a733add01818e6fc44482343ef3 /gcc/c-tree.h | |
parent | 67dd4a937789286c3903508be8662fb93051b1c3 (diff) | |
download | gcc-3b53cddc38abb716ac6b300d68cfe841a3a4f265.zip gcc-3b53cddc38abb716ac6b300d68cfe841a3a4f265.tar.gz gcc-3b53cddc38abb716ac6b300d68cfe841a3a4f265.tar.bz2 |
c-tree.h (struct c_declspecs): Add const_p, volatile_p and restrict_p.
* c-tree.h (struct c_declspecs): Add const_p, volatile_p and
restrict_p.
(struct c_declarator): Change u.array.quals and pointer_quals to
int. Add u.array.attrs.
(quals_from_declspecs): New.
* c-decl.c (quals_from_declspecs): New.
(shadow_tag_warned): Give more specific message for useless type
qualifiers.
(build_array_declarator, set_array_declarator_inner,
grokdeclarator, make_pointer_declarator, build_null_declspecs,
declspecs_add_qual): Update for changed structures.
testsuite:
* gcc.dg/declspec-12.c: New test.
From-SVN: r87500
Diffstat (limited to 'gcc/c-tree.h')
-rw-r--r-- | gcc/c-tree.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/c-tree.h b/gcc/c-tree.h index f860175..5d1ec30 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -180,6 +180,12 @@ struct c_declspecs { BOOL_BITFIELD inline_p : 1; /* Whether "__thread" was specified. */ BOOL_BITFIELD thread_p : 1; + /* Whether "const" was specified. */ + BOOL_BITFIELD const_p : 1; + /* Whether "volatile" was specified. */ + BOOL_BITFIELD volatile_p : 1; + /* Whether "restrict" was specified. */ + BOOL_BITFIELD restrict_p : 1; }; /* The various kinds of declarators in C. */ @@ -225,15 +231,17 @@ struct c_declarator { struct { /* The array dimension, or NULL for [] and [*]. */ tree dimen; - /* The qualifiers (and attributes, currently ignored) inside []. */ - struct c_declspecs *quals; + /* The qualifiers inside []. */ + int quals; + /* The attributes (currently ignored) inside []. */ + tree attrs; /* Whether [static] was used. */ BOOL_BITFIELD static_p : 1; /* Whether [*] was used. */ BOOL_BITFIELD vla_unspec_p : 1; } array; /* For pointers, the qualifiers on the pointer type. */ - struct c_declspecs *pointer_quals; + int pointer_quals; /* For attributes. */ tree attrs; } u; @@ -297,6 +305,7 @@ extern void c_expand_body (tree); extern void c_init_decl_processing (void); extern void c_dup_lang_specific_decl (tree); extern void c_print_identifier (FILE *, tree, int); +extern int quals_from_declspecs (const struct c_declspecs *); extern struct c_declarator *build_array_declarator (tree, struct c_declspecs *, bool, bool); extern tree build_enumerator (tree, tree); |