mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-03 07:10:28 +08:00
re PR c/28502 (ICE with invalid declaration after definition)
PR c/28502 * c-decl.c (validate_proto_after_old_defn): Return false on invalid argument. * gcc.dg/proto-1.c: New test. From-SVN: r115957
This commit is contained in:
parent
c0bcacec2d
commit
ffc44ab683
@ -1,5 +1,9 @@
|
||||
2006-08-05 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
PR c/28502
|
||||
* c-decl.c (validate_proto_after_old_defn): Return false on invalid
|
||||
argument.
|
||||
|
||||
PR c/27721
|
||||
* c-typeck.c (build_modify_expr): Test earlier for non-lvalues.
|
||||
|
||||
|
10
gcc/c-decl.c
10
gcc/c-decl.c
@ -1083,8 +1083,14 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
tree oldargtype = TYPE_MAIN_VARIANT (TREE_VALUE (oldargs));
|
||||
tree newargtype = TYPE_MAIN_VARIANT (TREE_VALUE (newargs));
|
||||
tree oldargtype = TREE_VALUE (oldargs);
|
||||
tree newargtype = TREE_VALUE (newargs);
|
||||
|
||||
if (oldargtype == error_mark_node || newargtype == error_mark_node)
|
||||
return false;
|
||||
|
||||
oldargtype = TYPE_MAIN_VARIANT (oldargtype);
|
||||
newargtype = TYPE_MAIN_VARIANT (newargtype);
|
||||
|
||||
if (END_OF_ARGLIST (oldargtype) && END_OF_ARGLIST (newargtype))
|
||||
break;
|
||||
|
@ -1,5 +1,8 @@
|
||||
2006-08-05 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
PR c/28502
|
||||
* gcc.dg/proto-1.c: New test.
|
||||
|
||||
PR c/27721
|
||||
* gcc.dg/lvalue-4.c: New test.
|
||||
|
||||
|
5
gcc/testsuite/gcc.dg/proto-1.c
Normal file
5
gcc/testsuite/gcc.dg/proto-1.c
Normal file
@ -0,0 +1,5 @@
|
||||
/* PR c/28502 */
|
||||
/* { dg-do compile } */
|
||||
|
||||
void foo() {} /* { dg-error "previous" } */
|
||||
void foo(void[]); /* { dg-error "array of voids" } */
|
Loading…
x
Reference in New Issue
Block a user