[PR c++/84492] stmt expr ending with overload
commitd5e30f014b697f1483904a7d214e1a9e124f8534
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Mar 2018 06:24:40 +0000 (6 06:24 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Mar 2018 06:24:40 +0000 (6 06:24 +0000)
tree20819b137643b69d6eadb2f84b1076132aff78cf
parentb35ddf186414e2d7c64ef5bdedb2127f3c814711
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258269 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr84492.C [new file with mode: 0644]