diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-05-16 14:46:30 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-05-16 14:46:30 +0000 |
commit | 3f267553fca2671ca4abb0dbbe3c9f625357edf0 (patch) | |
tree | 75f1cd1884906c9e7903a3f2d97c780e17e2066f /gcc/cp/lambda.c | |
parent | 058c785479b1652ffd47d397a9693fe5e5fdea39 (diff) | |
download | gcc-3f267553fca2671ca4abb0dbbe3c9f625357edf0.zip gcc-3f267553fca2671ca4abb0dbbe3c9f625357edf0.tar.gz gcc-3f267553fca2671ca4abb0dbbe3c9f625357edf0.tar.bz2 |
cp-tree.h (class ovl_iterator, [...]): New OVERLOAD iterators.
* cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
iterators.
(MAYBE_BASELINK_FUNCTIONS): New.
* constraint.cc (resolve_constraint_check): Use lkp_iterator.
* decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
* lambda.c (maybe_generic_this_capture): Use lkp_iterator.
* method.c (inherited_ctor_binfo): Use ovl_iterator.
(binfo_inherited_from): Likewise.
* parser.c (lookup_literal_operator): Use lkp_iterator.
* pt.c (iterative_hash_template_arg): Use lkp_iterator.
(print_candidates_1): Likewise.
(determine_specialization): Likewise.
(resolve_overloaded_unification): Likewise.
(resolve_nondeduced_context): Likewise.
(type_dependent_expression_p): Likewise.
(dependent_template_p): Likewise.
* ptree.c (cxx_print_xnode): Likewise.
* semantics.c (omp_reduction_lookup): Use lkp_iterator.
(classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
* typeck.c (check_template_keyword): Use lkp_iterator.
From-SVN: r248112
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 80643ea..9d7701f 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -841,18 +841,15 @@ maybe_generic_this_capture (tree object, tree fns) bool id_expr = TREE_CODE (fns) == TEMPLATE_ID_EXPR; if (id_expr) fns = TREE_OPERAND (fns, 0); - for (; fns; fns = OVL_NEXT (fns)) - { - tree fn = OVL_CURRENT (fns); - - if ((!id_expr || TREE_CODE (fn) == TEMPLATE_DECL) - && DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)) - { - /* Found a non-static member. Capture this. */ - lambda_expr_this_capture (lam, true); - break; - } - } + + for (lkp_iterator iter (fns); iter; ++iter) + if ((!id_expr || TREE_CODE (*iter) == TEMPLATE_DECL) + && DECL_NONSTATIC_MEMBER_FUNCTION_P (*iter)) + { + /* Found a non-static member. Capture this. */ + lambda_expr_this_capture (lam, true); + break; + } } } |