aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-03-08 08:42:51 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-03-08 08:42:51 +0100
commit560a46a5914a3cc55ade0cb0fe3d8e36d85d01cd (patch)
tree3952878b0b5439a6a72ebad3975d33a1aa0b2cc3 /gcc/cp
parent1d28bbdf471936be77705fbf27ac6934b67382f3 (diff)
downloadgcc-560a46a5914a3cc55ade0cb0fe3d8e36d85d01cd.zip
gcc-560a46a5914a3cc55ade0cb0fe3d8e36d85d01cd.tar.gz
gcc-560a46a5914a3cc55ade0cb0fe3d8e36d85d01cd.tar.bz2
re PR c++/89622 (G++ prints notes, but no warning or error)
PR c++/89622 * call.c (joust): Call print_z_candidate only if pedwarn returned true. * g++.dg/warn/pr89622.C: New test. From-SVN: r269481
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/call.c14
2 files changed, 14 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ae5735d..9bdb493 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2019-03-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/89622
+ * call.c (joust): Call print_z_candidate only if pedwarn returned
+ true.
+
2019-03-07 Jason Merrill <jason@redhat.com>
PR c++/88123 - lambda and using-directive.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index d9294a0..c50d9c8 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -10954,12 +10954,14 @@ tweak:
if (warn)
{
auto_diagnostic_group d;
- pedwarn (input_location, 0,
- "ISO C++ says that these are ambiguous, even "
- "though the worst conversion for the first is better than "
- "the worst conversion for the second:");
- print_z_candidate (input_location, _("candidate 1:"), w);
- print_z_candidate (input_location, _("candidate 2:"), l);
+ if (pedwarn (input_location, 0,
+ "ISO C++ says that these are ambiguous, even "
+ "though the worst conversion for the first is "
+ "better than the worst conversion for the second:"))
+ {
+ print_z_candidate (input_location, _("candidate 1:"), w);
+ print_z_candidate (input_location, _("candidate 2:"), l);
+ }
}
else
add_warning (w, l);