diff options
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r-- | gcc/cp/init.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 6edc0a5df8b..2ee24739259 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -3637,7 +3637,9 @@ build_vec_init (tree base, tree maxindex, tree init, if (TREE_CODE (type) == ARRAY_TYPE) m = cp_build_binary_op (input_location, MULT_EXPR, m, - array_type_nelts_total (type), + /* Avoid mixing signed and unsigned. */ + convert (TREE_TYPE (m), + array_type_nelts_total (type)), complain); finish_cleanup_try_block (try_block); |