aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/c/ChangeLog5
-rw-r--r--gcc/c/c-parser.c4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/decl-10.c13
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" } */
+{}