aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2021-10-23 05:45:02 -0400
committerJason Merrill <jason@redhat.com>2021-11-04 11:35:54 -0400
commitfae00a0ac0e5687343a60ae02bf60352002ab9aa (patch)
treeb929b52de9cd73a11c5fcf2848b8ea23a84e009d /gcc/cp/decl.c
parenteb04ccf4bfd6586cf0d22d439de28a4e6c649182 (diff)
downloadgcc-fae00a0ac0e5687343a60ae02bf60352002ab9aa.zip
gcc-fae00a0ac0e5687343a60ae02bf60352002ab9aa.tar.gz
gcc-fae00a0ac0e5687343a60ae02bf60352002ab9aa.tar.bz2
c++: use range-for more
gcc/cp/ChangeLog: * call.c (build_array_conv): Use range-for. (build_complex_conv): Likewise. * constexpr.c (clear_no_implicit_zero) (reduced_constant_expression_p): Likewise. * decl.c (cp_complete_array_type): Likewise. * decl2.c (mark_vtable_entries): Likewise. * pt.c (iterative_hash_template_arg): (invalid_tparm_referent_p, unify) (type_dependent_expression_p): Likewise. * typeck.c (build_ptrmemfunc_access_expr): Likewise.
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 7c2a134..947bbfc 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9538,9 +9538,6 @@ cp_complete_array_type (tree *ptype, tree initial_value, bool do_default)
if (initial_value)
{
- unsigned HOST_WIDE_INT i;
- tree value;
-
/* An array of character type can be initialized from a
brace-enclosed string constant.
@@ -9562,14 +9559,9 @@ cp_complete_array_type (tree *ptype, tree initial_value, bool do_default)
/* If any of the elements are parameter packs, we can't actually
complete this type now because the array size is dependent. */
if (TREE_CODE (initial_value) == CONSTRUCTOR)
- {
- FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (initial_value),
- i, value)
- {
- if (PACK_EXPANSION_P (value))
- return 0;
- }
- }
+ for (auto &e: CONSTRUCTOR_ELTS (initial_value))
+ if (PACK_EXPANSION_P (e.value))
+ return 0;
}
failure = complete_array_type (ptype, initial_value, do_default);