c++: braced-list overload resolution [PR100963]
authorJason Merrill <jason@redhat.com>
Tue, 8 Jun 2021 13:19:58 +0000 (09:19 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 8 Jun 2021 17:28:02 +0000 (13:28 -0400)
commit91349e57bbfd010156b9128b2ad751c8843e7245
treeccede00a9fe5084f015b879f210916bcd0a72236
parent69bb37f9e0143fbca3124069c0e9b6937ccf1fc7
c++: braced-list overload resolution [PR100963]

My PR969626 patch made us ignore template candidates when there's a perfect
non-template candidate.  In this case, we were considering B(int) a perfect
match for B({0}), but the brace elision makes it imperfect.

PR c++/100963

gcc/cp/ChangeLog:

* call.c (perfect_conversion_p): Check check_narrowing.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/initlist124.C: New test.
gcc/cp/call.c
gcc/testsuite/g++.dg/cpp0x/initlist124.C [new file with mode: 0644]