PR c++/60531 - Wrong error about unresolved overloaded function
authorHarald van Dijk <harald@gigawatt.nl>
Tue, 4 Jun 2019 14:48:38 +0000 (16:48 +0200)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 4 Jun 2019 14:48:38 +0000 (10:48 -0400)
commit7b9202ea9ee9b9147a2c2e3f478f1f3eb0b5c174
tree09a05fcf0d7ab47821b96c882f7a163f5b69a85b
parentecdcd56094cadc7bd3c18a0edd19f00d670e0d9b
PR c++/60531 - Wrong error about unresolved overloaded function

For PR60531, GCC wrongly rejects function templates with explicitly
specified template arguments as overloaded. They are resolved by
resolve_nondeduced_context, which is normally called by
cp_default_conversion through decay_conversion, but the latter have
extra effects making them unusable here. Calling the former directly
does work.

* typeck.c (cp_build_binary_op): See if overload can be resolved.
(cp_build_unary_op): Ditto.

* g++.dg/template/operator15.C: New test.

From-SVN: r271910
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/g++.dg/template/operator15.C [new file with mode: 0644]