aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/call.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/call.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/call.c')
-rw-r--r--gcc/cp/call.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 20e66c6..01ac114 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -1070,8 +1070,6 @@ build_array_conv (tree type, tree ctor, int flags, tsubst_flags_t complain)
conversion *c;
unsigned HOST_WIDE_INT len = CONSTRUCTOR_NELTS (ctor);
tree elttype = TREE_TYPE (type);
- unsigned i;
- tree val;
bool bad = false;
bool user = false;
enum conversion_rank rank = cr_exact;
@@ -1089,10 +1087,10 @@ build_array_conv (tree type, tree ctor, int flags, tsubst_flags_t complain)
flags = LOOKUP_IMPLICIT|LOOKUP_NO_NARROWING;
- FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (ctor), i, val)
+ for (auto &e: CONSTRUCTOR_ELTS (ctor))
{
conversion *sub
- = implicit_conversion (elttype, TREE_TYPE (val), val,
+ = implicit_conversion (elttype, TREE_TYPE (e.value), e.value,
false, flags, complain);
if (sub == NULL)
return NULL;
@@ -1124,8 +1122,6 @@ build_complex_conv (tree type, tree ctor, int flags,
conversion *c;
unsigned HOST_WIDE_INT len = CONSTRUCTOR_NELTS (ctor);
tree elttype = TREE_TYPE (type);
- unsigned i;
- tree val;
bool bad = false;
bool user = false;
enum conversion_rank rank = cr_exact;
@@ -1135,10 +1131,10 @@ build_complex_conv (tree type, tree ctor, int flags,
flags = LOOKUP_IMPLICIT|LOOKUP_NO_NARROWING;
- FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (ctor), i, val)
+ for (auto &e: CONSTRUCTOR_ELTS (ctor))
{
conversion *sub
- = implicit_conversion (elttype, TREE_TYPE (val), val,
+ = implicit_conversion (elttype, TREE_TYPE (e.value), e.value,
false, flags, complain);
if (sub == NULL)
return NULL;