From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.dg/Wcxx-compat-10.c | 73 +++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/Wcxx-compat-10.c (limited to 'gcc/testsuite/gcc.dg/Wcxx-compat-10.c') diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-10.c b/gcc/testsuite/gcc.dg/Wcxx-compat-10.c new file mode 100644 index 000000000..0f1d037bf --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wcxx-compat-10.c @@ -0,0 +1,73 @@ +/* { dg-do compile } */ +/* { dg-options "-Wc++-compat" } */ + +struct s1 { int f; }; +typedef int s2; +void +f1 () +{ + typedef int s1; + struct s2 { int f; }; +} + +struct s3 { int f; }; +typedef struct s3 s3; + +typedef struct s4 s4; +struct s4 { int f; }; + +struct s5 { int f; }; /* { dg-message "note: originally defined here" } */ +typedef int s5; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + +typedef int s6; /* { dg-message "note: originally defined here" } */ +struct s6 { int f; }; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + +void +f2 () +{ + struct s7 { int f; }; /* { dg-message "note: originally defined here" } */ + typedef int s7; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + + typedef int s8; /* { dg-message "note: originally defined here" } */ + struct s8 { int f; }; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + + struct s9 { int f; }; + { typedef int s9; } + + typedef int s10; + { struct s10 { int f; }; } +} + +enum e1 { A }; +typedef int e2; +void +f3 () +{ + typedef int e1; + enum e2 { B }; +} + +enum e3 { C }; +typedef enum e3 e3; + +enum e5 { E }; /* { dg-message "note: originally defined here" } */ +typedef int e5; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + +typedef int e6; /* { dg-message "note: originally defined here" } */ +enum e6 { F }; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + +void +f4 () +{ + enum e7 { G }; /* { dg-message "note: originally defined here" } */ + typedef int e7; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + + typedef int e8; /* { dg-message "note: originally defined here" } */ + enum e8 { H }; /* { dg-warning "invalid in C\[+\]\[+\]" } */ + + enum e9 { I }; + { typedef int e9; } + + typedef int e10; + { enum e10 { J }; } +} -- cgit v1.2.3