aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-12-02 08:33:06 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2015-12-02 08:33:06 +0100
commit657e4e47344408f7ca6b3c05bd86337dd424a3cf (patch)
tree0916e5db0f1f5a9235cadfad0dd148b31c92f286 /gcc/c
parentfe78aa0474d9469384951dbddcd5aeea5f40c03c (diff)
downloadgcc-657e4e47344408f7ca6b3c05bd86337dd424a3cf.zip
gcc-657e4e47344408f7ca6b3c05bd86337dd424a3cf.tar.gz
gcc-657e4e47344408f7ca6b3c05bd86337dd424a3cf.tar.bz2
re PR c/68533 (bogus location for "warning: ‘struct s3’ declared inside parameter list will not be visible outside of this definition or declaration")
PR c/68533 * c-decl.c (get_parm_info): Use b->locus instead of input_location for diagnostics. * gcc.dg/pr68533.c: New test. From-SVN: r231147
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-decl.c13
2 files changed, 13 insertions, 6 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 43d1579..acb8ee4 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2015-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/68533
+ * c-decl.c (get_parm_info): Use b->locus instead of input_location
+ for diagnostics.
+
2015-12-01 Julian Brown <julian@codesourcery.com>
Cesar Philippidis <cesar@codesourcery.com>
James Norris <James_Norris@mentor.com>
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 31de0a5..efb0a52 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -6913,11 +6913,11 @@ get_parm_info (bool ellipsis, tree expr)
{
if (TYPE_QUALS (TREE_TYPE (b->decl)) != TYPE_UNQUALIFIED
|| C_DECL_REGISTER (b->decl))
- error ("%<void%> as only parameter may not be qualified");
+ error_at (b->locus, "%<void%> as only parameter may not be qualified");
/* There cannot be an ellipsis. */
if (ellipsis)
- error ("%<void%> must be the only parameter");
+ error_at (b->locus, "%<void%> must be the only parameter");
arg_info->types = void_list_node;
return arg_info;
@@ -6946,13 +6946,14 @@ get_parm_info (bool ellipsis, tree expr)
/* Check for forward decls that never got their actual decl. */
if (TREE_ASM_WRITTEN (decl))
- error ("parameter %q+D has just a forward declaration", decl);
+ error_at (b->locus,
+ "parameter %q+D has just a forward declaration", decl);
/* Check for (..., void, ...) and issue an error. */
else if (VOID_TYPE_P (type) && !DECL_NAME (decl))
{
if (!gave_void_only_once_err)
{
- error ("%<void%> must be the only parameter");
+ error_at (b->locus, "%<void%> must be the only parameter");
gave_void_only_once_err = true;
}
}
@@ -6991,13 +6992,13 @@ get_parm_info (bool ellipsis, tree expr)
{
if (b->id)
/* The %s will be one of 'struct', 'union', or 'enum'. */
- warning_at (input_location, 0,
+ warning_at (b->locus, 0,
"%<%s %E%> declared inside parameter list"
" will not be visible outside of this definition or"
" declaration", keyword, b->id);
else
/* The %s will be one of 'struct', 'union', or 'enum'. */
- warning_at (input_location, 0,
+ warning_at (b->locus, 0,
"anonymous %s declared inside parameter list"
" will not be visible outside of this definition or"
" declaration", keyword);