diff options
author | Joseph Myers <joseph@codesourcery.com> | 2005-07-30 02:34:58 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2005-07-30 02:34:58 +0100 |
commit | 91d975b88eee06af82847fdb48c58e230506c72c (patch) | |
tree | 5b5a77889165a1437cae84a1933af1e14db1f0fd /gcc/testsuite/gcc.dg/parm-forwdecl-3.c | |
parent | 94ad79eaf5616f25f3edb2d2212742359603ce67 (diff) | |
download | gcc-91d975b88eee06af82847fdb48c58e230506c72c.tar.gz |
re PR c/23143 (parameter forward declarations broken)
PR c/23143
* c-parser.c (c_parser_parms_list_declarator): Call
mark_forward_parm_decls.
* c-decl.c (merge_decls): Only check DECL_IN_SYSTEM_HEADER for
decls with visibility structure.
testsuite:
* gcc.dg/parm-forwdecl-1.c, gcc.dg/parm-forwdecl-2.c,
gcc.dg/parm-forwdecl-3.c, gcc.dg/parm-forwdecl-4.c: New tests.
From-SVN: r102581
Diffstat (limited to 'gcc/testsuite/gcc.dg/parm-forwdecl-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/parm-forwdecl-3.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/parm-forwdecl-3.c b/gcc/testsuite/gcc.dg/parm-forwdecl-3.c new file mode 100644 index 00000000000..d99188a0bd4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/parm-forwdecl-3.c @@ -0,0 +1,8 @@ +/* Test GNU parameter forward declarations. Error with + -pedantic-errors. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ + +int f1(int a; int a); /* { dg-error "error: ISO C forbids forward parameter declarations" } */ +int f2(int a; int a) { return 0; } /* { dg-error "error: ISO C forbids forward parameter declarations" } */ |