diff options
-rw-r--r-- | gcc/c/c-decl.cc | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr101364-1.c | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc index 0de3847..7a145be 100644 --- a/gcc/c/c-decl.cc +++ b/gcc/c/c-decl.cc @@ -1899,7 +1899,8 @@ diagnose_arglist_conflict (tree newdecl, tree olddecl, break; } - if (c_type_promotes_to (type) != type) + if (!error_operand_p (type) + && c_type_promotes_to (type) != type) { inform (input_location, "an argument type that has a default " "promotion cannot match an empty parameter name list " diff --git a/gcc/testsuite/gcc.dg/pr101364-1.c b/gcc/testsuite/gcc.dg/pr101364-1.c new file mode 100644 index 0000000..e7c94a0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr101364-1.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-std=c90 "} */ + +void fruit(); /* { dg-message "previous declaration" } */ +void fruit( /* { dg-error "conflicting types for" } */ + int b[x], /* { dg-error "undeclared " } */ + short c) +{} /* { dg-message "an argument type that has a" } */ |