diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-11 05:20:08 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-11 05:20:08 +0000 |
commit | 9dd72ec43737ca9d1ec49315d4a5e0fdd3d578f2 (patch) | |
tree | 9f2ed3c3628913b10a211d8bef542c2772bafa97 /gcc/cp/name-lookup.c | |
parent | 41b45702e37640cb19b88ab0f8c335faf38025f0 (diff) | |
download | gcc-9dd72ec43737ca9d1ec49315d4a5e0fdd3d578f2.tar.gz |
Implement range-based for-statements.
* cp-tree.def (RANGE_FOR_STMT): New.
* cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
(cp_convert_range_for): Declare.
* pt.c (tsubst_expr): Add RANGE_FOR_STMT.
(tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
* semantics.c (begin_range_for_stmt): New.
(finish_range_for_decl): New.
(finish_for_stmt): Accept also RANGE_FOR_STMT.
(perform_koenig_lookup): Add extra argument include_std.
* parser.c (cp_parser_c_for): New with code from
cp_parser_iteration_statement().
(cp_parser_range_for): New.
(cp_convert_range_for): New.
(cp_parser_iteration_statement): Add range-for support.
(cp_parser_condition): Adjust comment.
(cp_parser_postfix_expression): perform_koenig_lookup takes extra
argument.
* dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
* cxx-pretty-print.c: Likewise.
* lex.c (cxx_init): Likewise.
* name-lookup.c (lookup_function_nonclass): Add extra argument
include_std.
(lookup_arg_dependent): Likewise.
* name-lookup.h: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164211 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r-- | gcc/cp/name-lookup.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index af6cef41229..41feb57898e 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4389,7 +4389,7 @@ lookup_function_nonclass (tree name, VEC(tree,gc) *args, bool block_p) lookup_arg_dependent (name, lookup_name_real (name, 0, 1, block_p, 0, LOOKUP_COMPLAIN), - args); + args, false); } tree @@ -5063,7 +5063,8 @@ arg_assoc (struct arg_lookup *k, tree n) are the functions found in normal lookup. */ tree -lookup_arg_dependent (tree name, tree fns, VEC(tree,gc) *args) +lookup_arg_dependent (tree name, tree fns, VEC(tree,gc) *args, + bool include_std) { struct arg_lookup k; @@ -5086,6 +5087,8 @@ lookup_arg_dependent (tree name, tree fns, VEC(tree,gc) *args) picking up later definitions) in the second stage. */ k.namespaces = make_tree_vector (); + if (include_std) + arg_assoc_namespace (&k, std_node); arg_assoc_args_vec (&k, args); fns = k.functions; |