OSDN Git Service

PR c/13801
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 26 Aug 2004 21:30:26 +0000 (21:30 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 26 Aug 2004 21:30:26 +0000 (21:30 +0000)
commit606a02e37d5fe4db6a2c5681e075a2bfc81c294f
tree73149f504f957d92e288572227263a1e93f7495d
parent8717605bddf703f04d36ffa38d357008cb3d0739
PR c/13801
* c-decl.c (struct c_binding): Add type and inner_comp fields.
(bind): Set type and inner_comp fields.
(pop_scope): Restore type of decl to the correct type from an
outer scope.  Give error when popping file scope for incomplete
arrays completed incompatibly with default initialization in an
inner scope.
(diagnose_mismatched_decls): Handle externs with initializers at
block scope.
(pushdecl): Set type of external declaration at block scope based
only on the visible declarations.  Save type when changing the
type of a declaration.  Merge an external declaration at block
scope with a visible static declaration at file scope.
(implicitly_declare): Give recycled old declaration the new type
except for incompatible declarations of built-in functions, saving
the old type.

testsuite:
* gcc.dg/redecl-3.c, gcc.dg/redecl-4.c, gcc.dg/redecl-6.c,
gcc.dg/redecl-7.c, gcc.dg/redecl-8.c, gcc.dg/redecl-9.c,
gcc.dg/redecl-10.c, gcc.dg/debug/redecl-1.c,
gcc.dg/debug/redecl-2.c, gcc.dg/debug/redecl-3.c,
gcc.dg/debug/redecl-4.c, gcc.dg/debug/redecl-5.c: New tests.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86636 138bc75d-0d04-0410-961f-82ee72b054a4
15 files changed:
gcc/ChangeLog
gcc/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/redecl-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/redecl-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/redecl-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/redecl-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/debug/redecl-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/redecl-10.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/redecl-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/redecl-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/redecl-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/redecl-7.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/redecl-8.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/redecl-9.c [new file with mode: 0644]