diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-13 00:38:49 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-13 00:38:49 +0000 |
commit | 4fba5eb95587cdfbbc183874bdc5b044f10b713c (patch) | |
tree | e843a9dc913b73d2b8924f2993e8aaeee0c8be4f /gcc/c-family | |
parent | ded3d3f8abc23c9641c8a975da35e16b26ce432a (diff) | |
download | gcc-4fba5eb95587cdfbbc183874bdc5b044f10b713c.tar.gz |
* doc/extend.texi (Statement Exprs, Typeof): Discuss __auto_type.
* ginclude/stdatomic.h (kill_dependency, atomic_store_explicit)
(atomic_load_explicit, atomic_exchange_explicit)
(atomic_compare_exchange_strong_explicit)
(atomic_compare_exchange_weak_explicit): Use __auto_type to
declare variable initialized with PTR argument.
c-family:
* c-common.h (enum rid): Add RID_AUTO_TYPE.
* c-common.c (c_common_reswords): Add __auto_type.
(keyword_begins_type_specifier): Handle RID_AUTO_TYPE.
c:
* c-tree.h (c_typespec_keyword): Add cts_auto_type.
* c-decl.c (declspecs_add_type, finish_declspecs): Handle
__auto_type.
* c-parser.c (c_token_starts_typename, c_token_starts_declspecs)
(c_parser_attribute_any_word, c_parser_objc_selector): Handle
RID_AUTO_TYPE.
(c_parser_declspecs): Take argument AUTO_TYPE_OK.
(c_parser_declaration_or_fndef, c_parser_struct_declaration)
(c_parser_declarator, c_parser_direct_declarator_inner)
(c_parser_parameter_declaration, c_parser_type_name): All callers
changed.
(c_parser_declaration_or_fndef): Handle declarations with type
determined from the initializer.
testsuite:
* gcc.dg/atomic/stdatomic-vm.c, gcc.dg/auto-type-1.c,
gcc.dg/auto-type-2.c: New tests.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204731 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 2 | ||||
-rw-r--r-- | gcc/c-family/c-common.h | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 57063bc5f76..e4e6163e091 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2013-11-13 Joseph Myers <joseph@codesourcery.com> + + * c-common.h (enum rid): Add RID_AUTO_TYPE. + * c-common.c (c_common_reswords): Add __auto_type. + (keyword_begins_type_specifier): Handle RID_AUTO_TYPE. + 2013-11-12 Andrew MacLeod <amacleod@redhat.com> * c-family/c-common.c: Include gimplify.h. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 835d22c6cf9..1f5e4ededa1 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -434,6 +434,7 @@ const struct c_common_resword c_common_reswords[] = { "__asm__", RID_ASM, 0 }, { "__attribute", RID_ATTRIBUTE, 0 }, { "__attribute__", RID_ATTRIBUTE, 0 }, + { "__auto_type", RID_AUTO_TYPE, D_CONLY }, { "__bases", RID_BASES, D_CXXONLY }, { "__builtin_choose_expr", RID_CHOOSE_EXPR, D_CONLY }, { "__builtin_complex", RID_BUILTIN_COMPLEX, D_CONLY }, @@ -11551,6 +11552,7 @@ keyword_begins_type_specifier (enum rid keyword) { switch (keyword) { + case RID_AUTO_TYPE: case RID_INT: case RID_CHAR: case RID_FLOAT: diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index 74fd59fb5ee..d9d2c44097a 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -102,7 +102,7 @@ enum rid RID_EXTENSION, RID_IMAGPART, RID_REALPART, RID_LABEL, RID_CHOOSE_EXPR, RID_TYPES_COMPATIBLE_P, RID_BUILTIN_COMPLEX, RID_BUILTIN_SHUFFLE, RID_DFLOAT32, RID_DFLOAT64, RID_DFLOAT128, - RID_FRACT, RID_ACCUM, + RID_FRACT, RID_ACCUM, RID_AUTO_TYPE, /* C11 */ RID_ALIGNAS, RID_GENERIC, |