aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2010-10-27 17:42:36 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-10-27 17:42:36 -0400
commit81f0bab25ec7d17b84e94ee7322aa953a75584a7 (patch)
treeffd5d52f502eeecf4274ffa2c4c9a0e6c6360099 /gcc/cp
parent5ac13b8e0c688dcf1251aee3f90eddfc1e5ba43f (diff)
downloadgcc-81f0bab25ec7d17b84e94ee7322aa953a75584a7.zip
gcc-81f0bab25ec7d17b84e94ee7322aa953a75584a7.tar.gz
gcc-81f0bab25ec7d17b84e94ee7322aa953a75584a7.tar.bz2
c-common.c (check_case_value): Remove special C++ code.
c-family/ * c-common.c (check_case_value): Remove special C++ code. cp/ * decl.c (finish_case_label): Use decl_constant_value. From-SVN: r166019
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog2
-rw-r--r--gcc/cp/decl.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8402c72..6efa96a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,6 +1,8 @@
2010-10-27 Gabriel Dos Reis <gdr@cse.tamu.edu>
Jason Merrill <jason@redhat.com>
+ * decl.c (finish_case_label): Use decl_constant_value.
+
* method.c (synthesized_method_walk): Track constexprness too.
(process_subob_fn, walk_field_subobs): Likewise.
(implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 8b2af9cd..d73d109 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2938,6 +2938,11 @@ finish_case_label (location_t loc, tree low_value, tree high_value)
if (!check_switch_goto (switch_stack->level))
return error_mark_node;
+ if (low_value)
+ low_value = decl_constant_value (low_value);
+ if (high_value)
+ high_value = decl_constant_value (high_value);
+
r = c_add_case_label (loc, switch_stack->cases, cond,
SWITCH_STMT_TYPE (switch_stack->switch_stmt),
low_value, high_value);