Commit ffea5536 by Ville Voutilainen Committed by Ville Voutilainen

Remove support for N3994, terse range-for, which was not adopted.

/cp
2015-10-31  Ville Voutilainen  <ville.voutilainen@gmail.com>

	Remove the implementation of N3994, terse range-for loops.
	* parser.c (cp_parser_for_init_statement): Remove the parsing
	of a terse range-for.

/testsuite
2015-10-31  Ville Voutilainen  <ville.voutilainen@gmail.com>

	Remove the implementation of N3994, terse range-for loops.
	* g++.dg/cpp1z/range-for1.C: Remove.

From-SVN: r229632
parent d057afcd
2015-10-31 Ville Voutilainen <ville.voutilainen@gmail.com>
Remove the implementation of N3994, terse range-for loops.
* parser.c (cp_parser_for_init_statement): Remove the parsing
of a terse range-for.
2015-10-31 Jason Merrill <jason@redhat.com> 2015-10-31 Jason Merrill <jason@redhat.com>
Implement multiple 'auto' feature from Concepts TS. Implement multiple 'auto' feature from Concepts TS.
......
...@@ -11279,22 +11279,6 @@ cp_parser_for_init_statement (cp_parser* parser, tree *decl) ...@@ -11279,22 +11279,6 @@ cp_parser_for_init_statement (cp_parser* parser, tree *decl)
bool is_range_for = false; bool is_range_for = false;
bool saved_colon_corrects_to_scope_p = parser->colon_corrects_to_scope_p; bool saved_colon_corrects_to_scope_p = parser->colon_corrects_to_scope_p;
if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
&& cp_lexer_nth_token_is (parser->lexer, 2, CPP_COLON))
{
/* N3994 -- for (id : init) ... */
if (cxx_dialect < cxx1z)
pedwarn (input_location, 0, "range-based for loop without a "
"type-specifier only available with "
"-std=c++1z or -std=gnu++1z");
tree name = cp_parser_identifier (parser);
tree type = cp_build_reference_type (make_auto (), /*rval*/true);
*decl = build_decl (input_location, VAR_DECL, name, type);
pushdecl (*decl);
cp_lexer_consume_token (parser->lexer);
return true;
}
/* A colon is used in range-based for. */ /* A colon is used in range-based for. */
parser->colon_corrects_to_scope_p = false; parser->colon_corrects_to_scope_p = false;
2015-10-31 Ville Voutilainen <ville.voutilainen@gmail.com>
Remove the implementation of N3994, terse range-for loops.
* g++.dg/cpp1z/range-for1.C: Remove.
2015-10-31 Eric Botcazou <ebotcazou@adacore.com> 2015-10-31 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/discr45.adb: New test. * gnat.dg/discr45.adb: New test.
......
// { dg-options "-std=c++1z -pedantic-errors" }
extern "C" int printf (const char *, ...);
#include <initializer_list>
int main()
{
for (i : {1,2})
{
printf ("%d ", i);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment