aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2016-06-15 20:13:39 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2016-06-15 20:13:39 +0000
commitc5f914a3c76702ed085f8bb753e594af8903699a (patch)
treee8a605fde60cc07f3228892dea54e391946e7703 /gcc
parentd7e16fc536d3e954adceb395e20c76258186330b (diff)
downloadgcc-c5f914a3c76702ed085f8bb753e594af8903699a.zip
gcc-c5f914a3c76702ed085f8bb753e594af8903699a.tar.gz
gcc-c5f914a3c76702ed085f8bb753e594af8903699a.tar.bz2
decl.c (wrapup_globals_for_namespace): Use DECL_SOURCE_LOCATION and "%qF" in warning_at instead of "%q+F" in warning.
2016-06-15 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (wrapup_globals_for_namespace): Use DECL_SOURCE_LOCATION and "%qF" in warning_at instead of "%q+F" in warning. (check_redeclaration_exception_specification): Likewise in pedwarn (and error, inform, for consistency). * call.c (joust): Likewise. From-SVN: r237496
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/call.c8
-rw-r--r--gcc/cp/decl.c17
3 files changed, 22 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7e68d05..d62ab39 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,13 @@
2016-06-15 Paolo Carlini <paolo.carlini@oracle.com>
+ * decl.c (wrapup_globals_for_namespace): Use DECL_SOURCE_LOCATION and
+ "%qF" in warning_at instead of "%q+F" in warning.
+ (check_redeclaration_exception_specification): Likewise in pedwarn
+ (and error, inform, for consistency).
+ * call.c (joust): Likewise.
+
+2016-06-15 Paolo Carlini <paolo.carlini@oracle.com>
+
PR c++/70202
* decl.c (xref_basetypes): Revert r117839 changes; add fix-up
code at the end of the for loop; also revert r159637 changes,
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index e2b89b8..475b380 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -9495,10 +9495,10 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn,
"default argument mismatch in "
"overload resolution"))
{
- inform (input_location,
- " candidate 1: %q+#F", cand1->fn);
- inform (input_location,
- " candidate 2: %q+#F", cand2->fn);
+ inform (DECL_SOURCE_LOCATION (cand1->fn),
+ " candidate 1: %q#F", cand1->fn);
+ inform (DECL_SOURCE_LOCATION (cand2->fn),
+ " candidate 2: %q#F", cand2->fn);
}
}
else
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 1aa5e52..830b3f5 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -914,8 +914,9 @@ wrapup_globals_for_namespace (tree name_space, void* data ATTRIBUTE_UNUSED)
&& !DECL_ARTIFICIAL (decl)
&& !TREE_NO_WARNING (decl))
{
- warning (OPT_Wunused_function,
- "%q+F declared %<static%> but never defined", decl);
+ warning_at (DECL_SOURCE_LOCATION (decl),
+ OPT_Wunused_function,
+ "%qF declared %<static%> but never defined", decl);
TREE_NO_WARNING (decl) = 1;
}
}
@@ -1233,18 +1234,20 @@ check_redeclaration_exception_specification (tree new_decl,
&& !comp_except_specs (new_exceptions, old_exceptions, ce_normal))
{
const char *msg
- = "declaration of %q+F has a different exception specifier";
+ = "declaration of %qF has a different exception specifier";
bool complained = true;
+ location_t new_loc = DECL_SOURCE_LOCATION (new_decl);
if (DECL_IN_SYSTEM_HEADER (old_decl))
- complained = pedwarn (0, OPT_Wsystem_headers, msg, new_decl);
+ complained = pedwarn (new_loc, OPT_Wsystem_headers, msg, new_decl);
else if (!flag_exceptions)
/* We used to silently permit mismatched eh specs with
-fno-exceptions, so make them a pedwarn now. */
- complained = pedwarn (0, OPT_Wpedantic, msg, new_decl);
+ complained = pedwarn (new_loc, OPT_Wpedantic, msg, new_decl);
else
- error (msg, new_decl);
+ error_at (new_loc, msg, new_decl);
if (complained)
- inform (0, "from previous declaration %q+F", old_decl);
+ inform (DECL_SOURCE_LOCATION (old_decl),
+ "from previous declaration %qF", old_decl);
}
}