summaryrefslogtreecommitdiff
path: root/gcc/c-tree.h
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-14 18:59:38 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-14 18:59:38 +0000
commitbb4762163b4edc6e12f262f5ecd6dda3bc66d5a6 (patch)
treefb8bf0df6ee54a733add01818e6fc44482343ef3 /gcc/c-tree.h
parentb368ada25fad9cc941cacfd0dc2be98bd3de1604 (diff)
downloadgcc-bb4762163b4edc6e12f262f5ecd6dda3bc66d5a6.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87500 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-tree.h')
-rw-r--r--gcc/c-tree.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index f8601754791..5d1ec30425c 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);