diff options
author | phython <phython@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-21 17:01:08 +0000 |
---|---|---|
committer | phython <phython@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-21 17:01:08 +0000 |
commit | 61ba37bfdc89277570f40931fdfeb82dfefc5585 (patch) | |
tree | 4f41c122c72dec3b860a1cabdb23536dbf18fbee /gcc/testsuite/gcc.dg/pr18596-1.c | |
parent | fedcccb5f9b79c9776b1429e3b4338e28efdef1f (diff) | |
download | gcc-61ba37bfdc89277570f40931fdfeb82dfefc5585.tar.gz |
2004-12-19 James A. Morrison <phython@gcc.gnu.org>
PR c/18596
* c-parse.in (initdcl): Don't process a declaration if start_decl fails.
(notype_initdcl): Don't process a declaration if start_decl fails.
* c-decl.c (start_decl): Fail if grokdeclarator fails.
(grokdeclarator): Fail if a function definition has an invalid storage
class.
* c-typeck.c (start_init): Treat error_mark_node the same as 0.
testsuite:
PR c/18596
* gcc.dg/funcdef-storage-1.c (foo): Remove.
* gcc.dg/pr18596-1.c: Use dg-error.
(dg-options): Use -fno-unit-at-a-time.
* gcc.dg/pr18596-2.c: New test.
* gcc.dg/pr18596-3.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92459 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr18596-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr18596-1.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/pr18596-1.c b/gcc/testsuite/gcc.dg/pr18596-1.c index 055d60a4a75..dc34f444e5d 100644 --- a/gcc/testsuite/gcc.dg/pr18596-1.c +++ b/gcc/testsuite/gcc.dg/pr18596-1.c @@ -1,7 +1,39 @@ /* { dg-do compile } */ +/* { dg-options "-fno-unit-at-a-time" } */ + int f(int i) { - static int g(); /* { dg-warning "invalid storage class" } */ - static int g() { return i; } /* { dg-warning "invalid storage class" } */ + static int g(); /* { dg-error "invalid storage class" } */ + static int g() { return i; } /* { dg-error "invalid storage class" } */ return g(); } + +int k (int i) +{ + static int g (); /* { dg-error "invalid storage class" } */ + int g () { + return i; + } + + return g (); +} + +int l (int i) +{ + auto int g (); + static int g () { /* { dg-error "invalid storage class" } */ + return i; + } + + static int h () { /* { dg-error "invalid storage class" } */ + return 3; + } + return g () + h (); +} + +int m (int i) +{ + static g (); /* { dg-error "invalid storage class" } */ + static g () { return i; } /* { dg-error "invalid storage class" } */ + return g (); +} |