diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-22 16:49:03 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-22 16:49:03 +0000 |
commit | b91bd47228cab7b9155ee4000be29657db44926f (patch) | |
tree | b04b7d452e4afa1ea57eb1317a2bd224cb2ab8f4 /gcc/testsuite/gcc.dg/Wcxx-compat-19.c | |
parent | 19b30c2a940f0a4dbe164d550c707c20f63bb48f (diff) | |
download | gcc-b91bd47228cab7b9155ee4000be29657db44926f.tar.gz |
./:
* config/linux.opt: Put mglibc ahead of muclibc.
* c-decl.c (diagnose_mismatched_decls): Add -Wc++-compat warning
for duplicate decls.
testsuite/:
* gcc.dg/Wcxx-compat-19.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148808 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wcxx-compat-19.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wcxx-compat-19.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-19.c b/gcc/testsuite/gcc.dg/Wcxx-compat-19.c new file mode 100644 index 00000000000..120ccf5c074 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wcxx-compat-19.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-Wc++-compat" } */ +int v1; /* { dg-message "previous declaration" } */ +int v1; /* { dg-warning "invalid in C\[+\]\[+\]" } */ +int v2; /* { dg-message "previous declaration" } */ +int v2 = 1; /* { dg-warning "invalid in C\[+\]\[+\]" } */ +extern int v3; +int v3; /* { dg-message "previous declaration" } */ +int v3 = 1; /* { dg-warning "invalid in C\[+\]\[+\]" } */ +extern int v4; +int v4 = 1; +static int v5; /* { dg-message "previous declaration" } */ +static int v5; /* { dg-warning "invalid in C\[+\]\[+\]" } */ +static int v6; /* { dg-message "previous declaration" } */ +static int v6 = 1; /* { dg-warning "invalid in C\[+\]\[+\]" } */ +int v7; +extern int v7; +int v8 = 1; +extern int v8; |