diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/declspec-14.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/declspec-14.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/declspec-14.c b/gcc/testsuite/gcc.dg/declspec-14.c new file mode 100644 index 000000000..d8ec78c9c --- /dev/null +++ b/gcc/testsuite/gcc.dg/declspec-14.c @@ -0,0 +1,11 @@ +/* Test that "typeof(struct foo)" and similar as declaration + specifiers act like typedef. */ +/* Origin: Joseph Myers <jsm@polyomino.org.uk> */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +typeof(struct foo); /* { dg-warning "useless type name in empty declaration" } */ + +struct bar { int a; } x; + +typeof(x); /* { dg-warning "useless type name in empty declaration" } */ |