diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2015-09-18 19:36:19 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2015-09-18 19:36:19 +0000 |
commit | c4914de6185a913d2dbb152a15b0c43b9d70106c (patch) | |
tree | 616fcade21d35e7c06e245ee5b7578f95ca8ad86 /gcc/c/c-parser.c | |
parent | edfc92491b22d1cd8f5fc1101cc148cc85f49441 (diff) | |
download | gcc-c4914de6185a913d2dbb152a15b0c43b9d70106c.zip gcc-c4914de6185a913d2dbb152a15b0c43b9d70106c.tar.gz gcc-c4914de6185a913d2dbb152a15b0c43b9d70106c.tar.bz2 |
Use explicit locations for some warnings in c-pragma.c.
gcc/cp/ChangeLog:
2015-09-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
* parser.c (pragma_lex): Add loc argument. Rearrange the code to
make it more similar to the C version.
gcc/c-family/ChangeLog:
2015-09-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c-pragma.c (handle_pragma_diagnostic): Use explicit location
when warning.
* c-pragma.h (pragma_lex): Add optional loc argument.
gcc/c/ChangeLog:
2015-09-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c-parser.c (pragma_lex): Add loc argument.
gcc/testsuite/ChangeLog:
2015-09-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/pragma-diag-5.c: New test.
From-SVN: r227923
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r-- | gcc/c/c-parser.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index d5de102..2fab3f0 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -9846,12 +9846,15 @@ c_parser_pragma (c_parser *parser, enum pragma_context context) /* The interface the pragma parsers have to the lexer. */ enum cpp_ttype -pragma_lex (tree *value) +pragma_lex (tree *value, location_t *loc) { c_token *tok = c_parser_peek_token (the_parser); enum cpp_ttype ret = tok->type; *value = tok->value; + if (loc) + *loc = tok->location; + if (ret == CPP_PRAGMA_EOL || ret == CPP_EOF) ret = CPP_EOF; else |