Commit 560a46a5 by Jakub Jelinek Committed by Jakub Jelinek

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
parent 1d28bbdf
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> 2019-03-07 Jason Merrill <jason@redhat.com>
PR c++/88123 - lambda and using-directive. PR c++/88123 - lambda and using-directive.
......
...@@ -10954,12 +10954,14 @@ tweak: ...@@ -10954,12 +10954,14 @@ tweak:
if (warn) if (warn)
{ {
auto_diagnostic_group d; auto_diagnostic_group d;
pedwarn (input_location, 0, if (pedwarn (input_location, 0,
"ISO C++ says that these are ambiguous, even " "ISO C++ says that these are ambiguous, even "
"though the worst conversion for the first is better than " "though the worst conversion for the first is "
"the worst conversion for the second:"); "better than the worst conversion for the second:"))
print_z_candidate (input_location, _("candidate 1:"), w); {
print_z_candidate (input_location, _("candidate 2:"), l); print_z_candidate (input_location, _("candidate 1:"), w);
print_z_candidate (input_location, _("candidate 2:"), l);
}
} }
else else
add_warning (w, l); add_warning (w, l);
......
2019-03-08 Jakub Jelinek <jakub@redhat.com>
PR c++/89622
* g++.dg/warn/pr89622.C: New test.
2019-03-07 Jakub Jelinek <jakub@redhat.com> 2019-03-07 Jakub Jelinek <jakub@redhat.com>
PR target/80003 PR target/80003
......
// PR c++/89622
// { dg-do compile { target c++11 } }
// { dg-options "-Wno-system-headers -w" }
// { dg-bogus "says that these are ambiguous" "" { target *-*-* } 0 }
// { dg-bogus "candidate 1" "" { target *-*-* } 0 }
// { dg-bogus "candidate 2" "" { target *-*-* } 0 }
# 3 "pr89622.h" 3
template<typename T>
struct X
{
X() { }
template<typename U> X(int, U&&) { }
template<typename U> X(char, const X<U>&) { }
};
template<typename T>
X<T> wrap_X(X<T> x)
{
return X<T>('a', x);
}
int main()
{
X<void> x;
wrap_X(x);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment