diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 14 |
2 files changed, 7 insertions, 12 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 29b70d02ad4..5bbeda665d9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2008-05-02 Simon Baldwin <simonb@google.com> + + PR bootstrap/36108 + * typeck.c (build_array_ref): Remove warn_array_subscript_range. + 2008-05-01 Simon Baldwin <simonb@google.com> * typeck.c (build_array_ref): Call warn_array_subscript_range. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 1447182ed01..bf264ad2cc7 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -2556,8 +2556,7 @@ build_array_ref (tree array, tree idx) if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE) { - bool has_warned_on_bounds_check = false; - tree rval, type, ref; + tree rval, type; warn_array_subscript_with_type_char (idx); @@ -2574,10 +2573,6 @@ build_array_ref (tree array, tree idx) pointer arithmetic.) */ idx = perform_integral_promotions (idx); - /* Warn about any obvious array bounds errors for fixed size arrays that - are indexed by a constant. */ - has_warned_on_bounds_check = warn_array_subscript_range (array, idx); - /* An array that is indexed by a non-constant cannot be stored in a register; we must be able to do address arithmetic on its address. @@ -2628,12 +2623,7 @@ build_array_ref (tree array, tree idx) |= (CP_TYPE_VOLATILE_P (type) | TREE_SIDE_EFFECTS (array)); TREE_THIS_VOLATILE (rval) |= (CP_TYPE_VOLATILE_P (type) | TREE_THIS_VOLATILE (array)); - ref = require_complete_type (fold_if_not_in_template (rval)); - - /* Suppress bounds warning in tree-vrp.c if already warned here. */ - if (has_warned_on_bounds_check) - TREE_NO_WARNING (ref) = 1; - return ref; + return require_complete_type (fold_if_not_in_template (rval)); } { |