diff options
author | Rodrigo Rivas Costa <rodrigorivascosta@gmail.com> | 2010-09-11 01:20:08 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-09-11 01:20:08 -0400 |
commit | f9132eb797d897b8e66b8e8ddb3e8e2744b6ac51 (patch) | |
tree | 9f2ed3c3628913b10a211d8bef542c2772bafa97 /gcc/cp/lex.c | |
parent | 8e5f2af21a1a93bf5743f00b8adf9c2bdeded8da (diff) | |
download | gcc-f9132eb797d897b8e66b8e8ddb3e8e2744b6ac51.zip gcc-f9132eb797d897b8e66b8e8ddb3e8e2744b6ac51.tar.gz gcc-f9132eb797d897b8e66b8e8ddb3e8e2744b6ac51.tar.bz2 |
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.
From-SVN: r164211
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r-- | gcc/cp/lex.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 0488149..8a894c7 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -226,8 +226,9 @@ cxx_init (void) CTOR_INITIALIZER, TRY_BLOCK, HANDLER, EH_SPEC_BLOCK, USING_STMT, TAG_DEFN, IF_STMT, CLEANUP_STMT, FOR_STMT, - WHILE_STMT, DO_STMT, BREAK_STMT, - CONTINUE_STMT, SWITCH_STMT, EXPR_STMT + RANGE_FOR_STMT, WHILE_STMT, DO_STMT, + BREAK_STMT, CONTINUE_STMT, SWITCH_STMT, + EXPR_STMT }; memset (&statement_code_p, 0, sizeof (statement_code_p)); |