re PR other/61963 (CilkPlus Array Notation ICE in build_array_notation_ref on malformed function arguments.)

PR other/61963

gcc/cp/
	* parser.c (cp_parser_array_notation): Added check for array_type.

gcc/testsuite/
	* c-c++-common/cilk-plus/AN/pr61963.c: New test.

From-SVN: r213494
This commit is contained in:
Igor Zamyatin 2014-08-01 17:20:02 +00:00 committed by Kirill Yukhin
parent a7ee52fba0
commit ffebf50f2f
4 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
PR other/61963
* parser.c (cp_parser_array_notation): Added check for array_type.
2014-07-08 Igor Zamyatin <igor.zamyatin@intel.com>
PR middle-end/61455

View File

@ -6376,7 +6376,7 @@ cp_parser_array_notation (location_t loc, cp_parser *parser, tree *init_index,
parser->colon_corrects_to_scope_p = saved_colon_corrects;
if (*init_index == error_mark_node || length_index == error_mark_node
|| stride == error_mark_node)
|| stride == error_mark_node || array_type == error_mark_node)
{
if (cp_lexer_peek_token (parser->lexer)->type == CPP_CLOSE_SQUARE)
cp_lexer_consume_token (parser->lexer);

View File

@ -1,3 +1,8 @@
2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
PR other/61963
* c-c++-common/cilk-plus/AN/pr61963.c: New test.
2014-07-08 Igor Zamyatin <igor.zamyatin@intel.com>
PR middle-end/61455

View File

@ -0,0 +1,9 @@
/* PR other/61963 */
/* { dg-do compile } */
/* { dg-options "-fcilkplus" } */
void f (int * int *a) /* { dg-error "expected" } */
{
a[0:64] = 0; /* { dg-error "was not declared" "" { target c++ } 7 } */
a[0:64] = 0;
}