diff options
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index dcbe6c7..7b7d96b 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -2858,27 +2858,18 @@ build_conditional_expr (arg1, arg2, arg3) and third operands. */ arg2_type = TREE_TYPE (arg2); arg3_type = TREE_TYPE (arg3); - if (same_type_p (TYPE_MAIN_VARIANT (arg2_type), void_type_node) - || same_type_p (TYPE_MAIN_VARIANT (arg3_type), void_type_node)) + if (VOID_TYPE_P (arg2_type) || VOID_TYPE_P (arg3_type)) { - int arg2_void_p; - int arg3_void_p; - /* Do the conversions. We don't these for `void' type arguments since it can't have any effect and since decay_conversion does not handle that case gracefully. */ - if (!same_type_p (TYPE_MAIN_VARIANT (arg2_type), void_type_node)) + if (!VOID_TYPE_P (arg2_type)) arg2 = decay_conversion (arg2); - if (!same_type_p (TYPE_MAIN_VARIANT (arg3_type), void_type_node)) + if (!VOID_TYPE_P (arg3_type)) arg3 = decay_conversion (arg3); arg2_type = TREE_TYPE (arg2); arg3_type = TREE_TYPE (arg3); - arg2_void_p = same_type_p (TYPE_MAIN_VARIANT (arg2_type), - void_type_node); - arg3_void_p = same_type_p (TYPE_MAIN_VARIANT (arg3_type), - void_type_node); - /* [expr.cond] One of the following shall hold: @@ -2893,12 +2884,12 @@ build_conditional_expr (arg1, arg2, arg3) ^ (TREE_CODE (arg3) == THROW_EXPR)) result_type = ((TREE_CODE (arg2) == THROW_EXPR) ? arg3_type : arg2_type); - else if (arg2_void_p && arg3_void_p) + else if (VOID_TYPE_P (arg2_type) && VOID_TYPE_P (arg3_type)) result_type = void_type_node; else { cp_error ("`%E' has type `void' and is not a throw-expression", - arg2_void_p ? arg2 : arg3); + VOID_TYPE_P (arg2_type) ? arg2 : arg3); return error_mark_node; } |