aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2019-01-17 22:58:22 -0500
committerJason Merrill <jason@gcc.gnu.org>2019-01-17 22:58:22 -0500
commitb0f422220aa1a1a98cd89177269ece2f8b2029fd (patch)
tree7879322f9e077f358b2a0b82a24c86a203fc4d0f /gcc/cp/call.c
parentaee6ed4a2cbed1ac8be35332ee2391206e2101a2 (diff)
downloadgcc-b0f422220aa1a1a98cd89177269ece2f8b2029fd.zip
gcc-b0f422220aa1a1a98cd89177269ece2f8b2029fd.tar.gz
gcc-b0f422220aa1a1a98cd89177269ece2f8b2029fd.tar.bz2
PR c++/86205 - ICE with ?: of throw and template-id.
My patch for 64372 removed a bogus lvalue-rvalue conversion for one arm of a ?: expression where the other arm is a throw. But we still need to require any overload to be resolved, even though we aren't getting that from decay_conversion anymore. * pt.c (resolve_nondeduced_context_or_error): Split out from... * typeck.c (decay_conversion): ...here. * call.c (build_conditional_expr_1): Use it. From-SVN: r268058
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 4f04b61..c639f5f 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -5067,6 +5067,19 @@ build_conditional_expr_1 (const op_location_t &loc,
arg3_type = unlowered_expr_type (arg3);
if (VOID_TYPE_P (arg2_type) || VOID_TYPE_P (arg3_type))
{
+ /* 'void' won't help in resolving an overloaded expression on the
+ other side, so require it to resolve by itself. */
+ if (arg2_type == unknown_type_node)
+ {
+ arg2 = resolve_nondeduced_context_or_error (arg2, complain);
+ arg2_type = TREE_TYPE (arg2);
+ }
+ if (arg3_type == unknown_type_node)
+ {
+ arg3 = resolve_nondeduced_context_or_error (arg3, complain);
+ arg3_type = TREE_TYPE (arg3);
+ }
+
/* [expr.cond]
One of the following shall hold: