aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-12-16 11:04:09 +0000
committerNathan Sidwell <nathan@codesourcery.com>2004-12-16 11:04:09 +0000
commitea5427e2a1b8f0e510439108d9d39817f4e6ee71 (patch)
treea82d5b1b25a2b0a52f0c9e6f96bfb4fbbb2d9e1c /gcc/cp/decl.c
parent9b396cd8a6488822d206604325148ed18e10b8d2 (diff)
cp:
PR c++/18905 * cp-tree.h (integral_constant_value): Declare. * call.c (null_ptr_cst_p): Use integral_constant_value, not decl_constant_value. (convert_like_real): Likewise. * class.c (check_bitfield_decl): Likewise. * cvt.c (ocp_convert): Likewise. (convert): Remove unnecessary decl_constant_value call. * decl.c (compute_array_index_type): Use integral_constant_value, not decl_constant_value. (build_enumerator): Likewise. * decl2.c (grokfield): Likewise. * init.c (decl_constant_value): Simplify. (integral_constant_value): New. * pt.c (fold_decl_constant_value): Use integral_constant_value, remove subsequent check. (tsubst): Use integral_constant_value, not decl_constant_value. (tsubst_copy, unify): Likewise. * typeck.c (decay_conversion): Likewise. (build_compound_expr): Remove unnecessary decl_constant_value calls. (build_static_cast_1, build_reinterpret_cast_1): (convert_for_assignment): Remove comment about not calling decl_constant_value. testsuite: PR c++/18905 * g++.dg/template/init4.C: New. * g++.dg/opt/static3.C: Enable optimizer. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@92257 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d711899bdaf..01a3312bfb8 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4853,6 +4853,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
&& !DECL_PRETTY_FUNCTION_P (decl)
&& !dependent_type_p (TREE_TYPE (decl)))
maybe_deduce_size_from_array_init (decl, init);
+
goto finish_end;
}
@@ -6207,7 +6208,7 @@ compute_array_index_type (tree name, tree size)
STRIP_TYPE_NOPS (size);
/* It might be a const variable or enumeration constant. */
- size = decl_constant_value (size);
+ size = integral_constant_value (size);
/* Normally, the array-bound will be a constant. */
if (TREE_CODE (size) == INTEGER_CST)
@@ -9792,7 +9793,7 @@ build_enumerator (tree name, tree value, tree enumtype)
/* Validate and default VALUE. */
if (value != NULL_TREE)
{
- value = decl_constant_value (value);
+ value = integral_constant_value (value);
if (TREE_CODE (value) == INTEGER_CST)
{