Commit e49a760f by Andrew Pinski Committed by Andrew Pinski

re PR c/43211 (ICE with incomplete type in function argument)

2010-03-19  Andrew Pinski  <andrew_pinski@caviumnetworks.com>

        PR C/43211
        * c-decl.c (grokparms): Set arg_types to NULL_TREE if there was an error.

2010-03-19  Andrew Pinski  <andrew_pinski@caviumnetworks.com>

        PR C/43211
        * gcc.dg/pr43211.c: New test.
        * gcc.dg/pr18809-1.c: Don't expect an error when calling foo.

From-SVN: r157585
parent fdb2c684
2010-03-19 Andrew Pinski <andrew_pinski@caviumnetworks.com>
PR C/43211
* c-decl.c (grokparms): Set arg_types to NULL_TREE if there was an error.
2010-03-19 Bernd Schmidt <bernd.schmidt@codesourcery.com> 2010-03-19 Bernd Schmidt <bernd.schmidt@codesourcery.com>
PR rtl-optimization/42258 PR rtl-optimization/42258
......
...@@ -6118,6 +6118,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag) ...@@ -6118,6 +6118,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
TREE_VALUE (typelt) = error_mark_node; TREE_VALUE (typelt) = error_mark_node;
TREE_TYPE (parm) = error_mark_node; TREE_TYPE (parm) = error_mark_node;
arg_types = NULL_TREE;
} }
else if (VOID_TYPE_P (type)) else if (VOID_TYPE_P (type))
{ {
...@@ -6138,6 +6139,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag) ...@@ -6138,6 +6139,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
error (errmsg); error (errmsg);
TREE_VALUE (typelt) = error_mark_node; TREE_VALUE (typelt) = error_mark_node;
TREE_TYPE (parm) = error_mark_node; TREE_TYPE (parm) = error_mark_node;
arg_types = NULL_TREE;
} }
if (DECL_NAME (parm) && TREE_USED (parm)) if (DECL_NAME (parm) && TREE_USED (parm))
......
2010-03-19 Andrew Pinski <andrew_pinski@caviumnetworks.com>
PR C/43211
* gcc.dg/pr43211.c: New test.
* gcc.dg/pr18809-1.c: Don't expect an error when calling foo.
2010-03-19 Bernd Schmidt <bernd.schmidt@codesourcery.com> 2010-03-19 Bernd Schmidt <bernd.schmidt@codesourcery.com>
PR rtl-optimization/42258 PR rtl-optimization/42258
......
...@@ -7,4 +7,4 @@ void foo(enum E e) {} /* { dg-error "forward ref" "forward" } */ ...@@ -7,4 +7,4 @@ void foo(enum E e) {} /* { dg-error "forward ref" "forward" } */
/* { dg-warning "declared" "declared" { target *-*-* } 6 } */ /* { dg-warning "declared" "declared" { target *-*-* } 6 } */
/* { dg-warning "scope" "scope" { target *-*-* } 6 } */ /* { dg-warning "scope" "scope" { target *-*-* } 6 } */
/* { dg-error "incomplete" "incomplete" { target *-*-* } 6 } */ /* { dg-error "incomplete" "incomplete" { target *-*-* } 6 } */
void bar() { foo(0); } /* { dg-error "formal" } */ void bar() { foo(0); }
/* { dg-do compile } */
struct T;
struct S {
void (*bar)(struct S);
};
void bar(struct T t) {} /* { dg-error "" } */
void foo(struct S *s)
{
s->bar = bar;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment