aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-tree.h
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-09-11 22:15:14 +0000
committerJoseph Myers <jsm@polyomino.org.uk>2004-09-11 22:15:14 +0000
commit389494cde3c4f8a21e84694a8c2f952f736d5769 (patch)
tree5528b98778c3ae40214dcdbfb32a36d789c31c3a /gcc/c-tree.h
parent5fd1f1bf6b0595eb45e9c3f223acb86ac2101b0f (diff)
* c-tree.h (enum c_storage_class): New.
(struct c_declspecs): Add storage_class, inline_p and thread_p. * c-decl.c (shadow_tag_warned): Give errors for "inline" in empty declarations and "auto" or "register" in file scope empty declarations. Give more specific warnings for other cases of storage class specifiers in empty declarations. (grokdeclarator): Update for new structures. Don't check for multiple storage classes. Diagnose file-scope "register" if pedantic. (build_null_declspecs): Update. (declspecs_add_scspec): Update. Diagnose multiple storage class specifiers and invalid uses of "__thread". testsuite: * gcc.dg/declspec-4.c, gcc.dg/declspec-5.c, gcc.dg/declspec-6.c, gcc.dg/tls/diag-2.c: Update expected messages. * gcc.dg/991209-1.c: Specify compilation options. Update expected messages. * gcc.dg/pr14289-2.c, gcc.dg/pr14289-3.c: Remove. * gcc.dg/declspec-7.c, gcc.dg/declspec-8.c, gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c, gcc.dg/tls/diag-4.c, gcc.dg/tls/diag-5.c: New tests. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@87376 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-tree.h')
-rw-r--r--gcc/c-tree.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index dde8dc3249d..0e28dfef3c0 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -131,6 +131,16 @@ struct c_expr
enum tree_code original_code;
};
+/* A storage class specifier. */
+enum c_storage_class {
+ csc_none,
+ csc_auto,
+ csc_extern,
+ csc_register,
+ csc_static,
+ csc_typedef
+};
+
/* A sequence of declaration specifiers in C. */
struct c_declspecs {
/* The type specified, not reflecting modifiers such as "short" and
@@ -144,6 +154,8 @@ struct c_declspecs {
tree attrs;
/* The modifier bits present. */
int specbits;
+ /* The storage class specifier, or csc_none if none. */
+ enum c_storage_class storage_class;
/* 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
@@ -164,6 +176,10 @@ struct c_declspecs {
BOOL_BITFIELD explicit_char_p : 1;
/* Whether "long" was specified more than once. */
BOOL_BITFIELD long_long_p : 1;
+ /* Whether "inline" was specified. */
+ BOOL_BITFIELD inline_p : 1;
+ /* Whether "__thread" was specified. */
+ BOOL_BITFIELD thread_p : 1;
};
/* The various kinds of declarators in C. */