c++: Better diagnostic in converted const expr.
authorJason Merrill <jason@redhat.com>
Mon, 11 May 2020 19:39:44 +0000 (15:39 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 11 May 2020 19:41:15 +0000 (15:41 -0400)
commit42e9f80bf4f6a38733c221c03a512c432cdb784f
tree4d97c0e9a64f2b380606b163b844722295161983
parentf981395c220c9afd73be138294946e085e64af78
c++: Better diagnostic in converted const expr.

This improves the diagnostic from

error: could not convert ‘((A<>*)(void)0)->A<>::e’ from
       ‘<unresolved overloaded function type>’ to ‘bool’

to

error: cannot convert ‘A<>::e’ from type ‘void (A<>::)()’ to type ‘bool’

gcc/cp/ChangeLog
2020-05-11  Jason Merrill  <jason@redhat.com>

* call.c (implicit_conversion_error): Split out from...
(perform_implicit_conversion_flags): ...here.
(build_converted_constant_expr_internal): Use it.
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/g++.dg/cpp0x/noexcept30.C
gcc/testsuite/g++.dg/cpp0x/noexcept58.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/crash87.C
gcc/testsuite/g++.dg/template/nontype13.C