re PR c/13801 (Decls should regain old type at end of scope)
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. From-SVN: r86636
Showing
gcc/testsuite/gcc.dg/debug/redecl-1.c
0 → 100644
gcc/testsuite/gcc.dg/debug/redecl-2.c
0 → 100644
gcc/testsuite/gcc.dg/debug/redecl-3.c
0 → 100644
gcc/testsuite/gcc.dg/debug/redecl-4.c
0 → 100644
gcc/testsuite/gcc.dg/debug/redecl-5.c
0 → 100644
gcc/testsuite/gcc.dg/redecl-10.c
0 → 100644
gcc/testsuite/gcc.dg/redecl-3.c
0 → 100644
This diff is collapsed.
Click to expand it.
gcc/testsuite/gcc.dg/redecl-4.c
0 → 100644
gcc/testsuite/gcc.dg/redecl-6.c
0 → 100644
gcc/testsuite/gcc.dg/redecl-7.c
0 → 100644
gcc/testsuite/gcc.dg/redecl-8.c
0 → 100644
gcc/testsuite/gcc.dg/redecl-9.c
0 → 100644
Please
register
or
sign in
to comment