diff options
author | Prathamesh Kulkarni <bilbotheelffriend@gmail.com> | 2014-02-19 18:51:57 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-02-19 18:51:57 +0000 |
commit | 1c9f5f333ab764cc2e4cdde8d7da98a65a6d8498 (patch) | |
tree | 4bb02f4dd4cbbfe6a5d665532bf14c2dd797e371 | |
parent | 128ed0903f387d1bf10e292da6c7428ca807cd2e (diff) | |
download | gcc-1c9f5f333ab764cc2e4cdde8d7da98a65a6d8498.zip gcc-1c9f5f333ab764cc2e4cdde8d7da98a65a6d8498.tar.gz gcc-1c9f5f333ab764cc2e4cdde8d7da98a65a6d8498.tar.bz2 |
c-parser.c (c_parser_declspecs): Replace call to error by error_at.
* c-parser.c (c_parser_declspecs): Replace call to error by error_at.
(c_parser_parameter_declaration): Likewise.
From-SVN: r207916
-rw-r--r-- | gcc/c/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/decl-10.c | 13 |
4 files changed, 24 insertions, 2 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 32d7242..5e482a3 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2014-02-19 Prathamesh Kulkarni <bilbotheelffriend@gmail.com> + + * c-parser.c (c_parser_declspecs): Replace call to error by error_at. + (c_parser_parameter_declaration): Likewise. + 2014-02-19 Marek Polacek <polacek@redhat.com> PR c/60195 diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 66625aa..d0d35c5 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -2223,7 +2223,7 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs, attrs_ok = true; if (kind == C_ID_ID) { - error ("unknown type name %qE", value); + error_at (loc, "unknown type name %qE", value); t.kind = ctsk_typedef; t.spec = error_mark_node; } @@ -3608,7 +3608,7 @@ c_parser_parameter_declaration (c_parser *parser, tree attrs) c_parser_set_source_position_from_token (token); if (c_parser_next_tokens_start_typename (parser, cla_prefer_type)) { - error ("unknown type name %qE", token->value); + error_at (token->location, "unknown type name %qE", token->value); parser->error = true; } /* ??? In some Objective-C cases '...' isn't applicable so there diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6396b37..ad6194f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-02-19 Prathamesh Kulkarni <bilbotheelffriend@gmail.com> + + * gcc.dg/decl-10.c: New test. + 2014-02-19 Jakub Jelinek <jakub@redhat.com> PR c++/60267 diff --git a/gcc/testsuite/gcc.dg/decl-10.c b/gcc/testsuite/gcc.dg/decl-10.c new file mode 100644 index 0000000..ec4259b --- /dev/null +++ b/gcc/testsuite/gcc.dg/decl-10.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ + +void +f4(const foo x) /* { dg-error "10:unknown type name" } */ +{} + +void +f5(foo x, int i) /* { dg-error "4:unknown type name" } */ +{} + +void +f6(char c, foo x, ...) /* { dg-error "12:unknown type name" } */ +{} |