summaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-01 15:31:12 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-01 15:31:12 +0000
commit8c37d3591562e19a7820e8d8c1186f9e5e5f9d60 (patch)
tree3a0a70e9966b269f5ebf022b1b4791ced82f6bd8 /gcc/c-parser.c
parent4caff2085622c6813fdbfa4b6a1041f097121454 (diff)
downloadgcc-8c37d3591562e19a7820e8d8c1186f9e5e5f9d60.tar.gz
gcc
* c-decl.c (grokdeclarator): Set decl source locations. * c-parser.c (c_parser_enum_specifier): Set location. (c_parser_struct_or_union_specifier): Likewise. gcc/testsuite * gcc.dg/redecl-1.c: Update. * gcc.dg/pr20368-3.c: Update. * gcc.dg/inline-14.c: Update. * gcc.dg/builtins-30.c: Update. * gcc.dg/dremf-type-compat-4.c: Update. * gcc.dg/pr20368-2.c: Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129822 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index bdf96ca6d92..29148266f9a 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -1707,6 +1707,8 @@ c_parser_enum_specifier (c_parser *parser)
gcc_assert (c_parser_next_token_is_keyword (parser, RID_ENUM));
c_parser_consume_token (parser);
attrs = c_parser_attributes (parser);
+ /* Set the location in case we create a decl now. */
+ c_parser_set_source_position_from_token (c_parser_peek_token (parser));
if (c_parser_next_token_is (parser, CPP_NAME))
{
ident = c_parser_peek_token (parser)->value;
@@ -1728,6 +1730,7 @@ c_parser_enum_specifier (c_parser *parser)
tree enum_value;
tree enum_decl;
bool seen_comma;
+ c_token *token;
if (c_parser_next_token_is_not (parser, CPP_NAME))
{
c_parser_error (parser, "expected identifier");
@@ -1735,7 +1738,10 @@ c_parser_enum_specifier (c_parser *parser)
values = error_mark_node;
break;
}
- enum_id = c_parser_peek_token (parser)->value;
+ token = c_parser_peek_token (parser);
+ enum_id = token->value;
+ /* Set the location in case we create a decl now. */
+ c_parser_set_source_position_from_token (token);
c_parser_consume_token (parser);
if (c_parser_next_token_is (parser, CPP_EQ))
{
@@ -1848,6 +1854,8 @@ c_parser_struct_or_union_specifier (c_parser *parser)
}
c_parser_consume_token (parser);
attrs = c_parser_attributes (parser);
+ /* Set the location in case we create a decl now. */
+ c_parser_set_source_position_from_token (c_parser_peek_token (parser));
if (c_parser_next_token_is (parser, CPP_NAME))
{
ident = c_parser_peek_token (parser)->value;