(grokdeclarator, ARRARY_REF): If exern, then end
authorJim Wilson <wilson@gcc.gnu.org>
Tue, 16 Mar 1993 20:11:12 +0000 (12:11 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 16 Mar 1993 20:11:12 +0000 (12:11 -0800)
temporary allocation before building type.

From-SVN: r3760

gcc/c-decl.c

index 80844596da8974f1470cf9941d173e4906588ab3..22056c9a7e01bcd8bbb3f9a7649bf183e06acc49 100644 (file)
@@ -4033,6 +4033,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
        {
          register tree itype = NULL_TREE;
          register tree size = TREE_OPERAND (declarator, 1);
+         /* An uninitialized decl with `extern' is a reference.  */
+         int extern_ref = !initialized && (specbits & (1 << (int) RID_EXTERN));
 
          declarator = TREE_OPERAND (declarator, 0);
 
@@ -4056,6 +4058,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
          if (type == error_mark_node)
            continue;
 
+         /* If this is a block level extern, it must live past the end
+            of the function so that we can check it against other extern
+            declarations (IDENTIFIER_LIMBO_VALUE).  */
+         if (extern_ref && allocation_temporary_p ())
+           end_temporary_allocation ();
+
          /* If size was specified, set ITYPE to a range-type for that size.
             Otherwise, ITYPE remains null.  finish_decl may figure it out
             from an initial value.  */