]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR other/61963 (CilkPlus Array Notation ICE in build_array_notation_ref on malform...
authorIgor Zamyatin <igor.zamyatin@intel.com>
Fri, 1 Aug 2014 17:20:02 +0000 (17:20 +0000)
committerKirill Yukhin <kyukhin@gcc.gnu.org>
Fri, 1 Aug 2014 17:20:02 +0000 (17:20 +0000)
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

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c [new file with mode: 0644]

index 017ec514510d04a25480181592960bf30a34aeb3..19244dd473af5f873b9fd544668478bd28a2a60f 100644 (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
index 32c7a3fe1469531c18536e74ff52c890335bc757..be071a89557405eeefdb074823c6bb54ef29482c 100644 (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);
index 95ebf2f6ae9166a135aae0956b16803322b4903d..1bf38ab4135f1c68903d02859bd8baf124081340 100644 (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
diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61963.c
new file mode 100644 (file)
index 0000000..dfa713c
--- /dev/null
@@ -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;
+}