re PR c/71265 (gcc ICE on x86_64-linux-gnu with “seg fault”)
authorMarek Polacek <polacek@redhat.com>
Wed, 25 May 2016 14:57:34 +0000 (14:57 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 25 May 2016 14:57:34 +0000 (14:57 +0000)
PR c/71265
* c-decl.c (c_make_fname_decl): Don't check seen_error.

* gcc.dg/noncompile/pr71265.c: New test.

From-SVN: r236707

gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/noncompile/pr71265.c [new file with mode: 0644]

index 2e3eeb1af3f7592b72ad462db49eec73375221ad..d74423b816def07c2b1e357a8db05f9fe1612a8c 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-25  Marek Polacek  <polacek@redhat.com>
+
+       PR c/71265
+       * c-decl.c (c_make_fname_decl): Don't check seen_error.
+
 2016-05-24  Cesar Philippidis  <cesar@codesourcery.com>
 
        * c-parser.c (c_parser_oacc_declare): Add support for
index 9441fbb3b40cfee42e3050d833382eeec0402c31..d7c3783d9898124d61f0a2594619fc6358cdbad2 100644 (file)
@@ -3989,7 +3989,7 @@ c_make_fname_decl (location_t loc, tree id, int type_dep)
         the __FUNCTION__ is believed to appear in K&R style function
         parameter declarator.  In that case we still don't have
         function_scope.  */
-      && (!seen_error () || current_function_scope))
+      && current_function_scope)
     {
       DECL_CONTEXT (decl) = current_function_decl;
       bind (id, decl, current_function_scope,
index d41af4e00c48a3c39998ca400262bc7d9664b278..c1a5372bb7a442ce7a8764cf19bdfd0f308fdbe6 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-25  Marek Polacek  <polacek@redhat.com>
+
+       PR c/71265
+       * gcc.dg/noncompile/pr71265.c: New test.
+
 2016-05-25  Nathan Sidwell  <nathan@acm.org>
 
        * gcc.c-torture/execute/921110-1.c: Fix abort decl.
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr71265.c b/gcc/testsuite/gcc.dg/noncompile/pr71265.c
new file mode 100644 (file)
index 0000000..9c62aab
--- /dev/null
@@ -0,0 +1,7 @@
+/* PR c/71265 */
+/* { dg-do compile } */
+
+void ID (ID)
+  int ID [__func__]; /* { dg-error "size of array .ID. has non-integer type" } */
+{
+}