]> git.ipfire.org Git - thirdparty/gcc.git/commit
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:29:02 +0000 (13:29 -0400)
commit5af06ce836d4d8d1654db3855db8b86a994faf49
tree11be50028c7b4b7515dacab448a21324da23358b
parent1c4471ecc737aff19221447e33a6110b88e64196
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]