[PR c++/84492] stmt expr ending with overload
authorAlexandre Oliva <aoliva@redhat.com>
Tue, 6 Mar 2018 06:24:40 +0000 (06:24 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Tue, 6 Mar 2018 06:24:40 +0000 (06:24 +0000)
commit1ea71a82f9d42684c542147b231afb63e8a6da8f
tree20819b137643b69d6eadb2f84b1076132aff78cf
parent4900146ce0cf227aee88a1bd3b152c9394c64771
[PR c++/84492] stmt expr ending with overload

We ICEd when returning a stmt expr that ends with an overloaded
function, because instantiate_type did not know what to do with
STMT_EXPRs.  And it shouldn't have to: the expected type of a stmt
expr cannot be used to resolve its value: an unresolved overload
cannot supply the result of a stmt expr.  Catch that and report the
error in the stmt expr before we have a chance to instantiate it.

for  gcc/cp/ChangeLog

PR c++/84492
* semantics.c (finish_stmt_expr_expr): Reject unresolved
overloads used as stmt expr values.

for  gcc/testsuite/ChangeLog

PR c++/84492
* g++.dg/pr84492.C: New.

From-SVN: r258269
gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr84492.C [new file with mode: 0644]