summaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-08 20:17:42 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-08 20:17:42 +0000
commita1f05651ed0d07a37b7120bb295c7d3dd0d94ed6 (patch)
tree29e021e2fec06d40962f55e47d182c721d950eae /gcc/cp/class.c
parent0fe7bca11f09108617e5c224ca900c066815722e (diff)
downloadgcc-a1f05651ed0d07a37b7120bb295c7d3dd0d94ed6.tar.gz
Correct conversion/overflow behavior.
* cvt.c (ignore_overflows): Move here from typeck.c. (ocp_convert): Use it. (cp_fold_convert): Use it. Don't call rvalue. * typeck.c (build_static_cast_1): Don't use it. Do call rvalue. * error.c (location_of): Handle expressions, too. * class.c (check_bitfield_decl): Set input_location around call to cxx_constant_value. * semantics.c (cxx_eval_outermost_constant_expr): Don't print the expression if it already had TREE_OVERFLOW set. (reduced_constant_expression_p): Check TREE_OVERFLOW_P for C++98, too. (verify_constant): Allow overflow with a permerror if we're enforcing. (cxx_eval_outermost_constant_expr): Use verify_constant. (adjust_temp_type): Use cp_fold_convert. * decl.c (build_enumerator): Don't call constant_expression_warning. * decl2.c (grokbitfield): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166453 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 435fa71c3f5..03951cfa4ea 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2797,11 +2797,14 @@ check_bitfield_decl (tree field)
}
else
{
+ location_t loc = input_location;
/* Avoid the non_lvalue wrapper added by fold for PLUS_EXPRs. */
STRIP_NOPS (w);
/* detect invalid field size. */
+ input_location = DECL_SOURCE_LOCATION (field);
w = cxx_constant_value (w);
+ input_location = loc;
if (TREE_CODE (w) != INTEGER_CST)
{