c++: Fix constrained conversion op.
authorJason Merrill <jason@redhat.com>
Fri, 28 Feb 2020 18:43:55 +0000 (13:43 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 28 Feb 2020 18:44:44 +0000 (13:44 -0500)
commit586b016cd48f5a5f6f2ba9f179105fabaa3e85dd
tree379a757243bef7feb91dd458350f7048ed4e3fa4
parent4735f92d48c373031be296fd0f7a2cf31fc955da
c++: Fix constrained conversion op.

We don't want to promote a conversion from viable == 0 to viable == -1.
Found in ranges-v3.

gcc/cp/ChangeLog
2020-02-28  Jason Merrill  <jason@redhat.com>

* call.c (build_user_type_conversion_1): Don't look at the second
conversion of a non-viable candidate.
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/g++.dg/cpp2a/concepts-conv1.C [new file with mode: 0644]