diff options
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index b7b5d85..d89aa5a 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -425,7 +425,7 @@ finish_expr_stmt (tree expr) && ((TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE && lvalue_p (expr)) || TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE)) - expr = default_conversion (expr); + expr = decay_conversion (expr); /* Remember the type of the expression. */ expr_type = TREE_TYPE (expr); @@ -748,7 +748,10 @@ finish_switch_cond (tree cond, tree switch_stmt) orig_type = TREE_TYPE (cond); if (cond != error_mark_node) { - cond = default_conversion (cond); + /* [stmt.switch] + + Integral promotions are performed. */ + cond = perform_integral_promotions (cond); cond = fold (build1 (CLEANUP_POINT_EXPR, TREE_TYPE (cond), cond)); } |