diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-12 21:16:20 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-12 21:16:20 +0000 |
commit | 4269c49ca94653f84fd5a5f4f5ed9ac4b9822869 (patch) | |
tree | e993739bf8bc3a9a389b46900f9bbbceaa67308b /gcc/testsuite/gcc.dg/pr51034.c | |
parent | b3e2a6c9a7ee815324c4902eb65f75152989ad61 (diff) | |
download | gcc-4269c49ca94653f84fd5a5f4f5ed9ac4b9822869.tar.gz |
PR c/53532
PR c/51034
PR c/53196
* c-decl.c (build_compound_literal): Call c_incomplete_type_error
if type isn't complete.
* gcc.dg/pr53532.c: New test.
* gcc.dg/c99-complit-2.c: Add two new dg-error directives,
adjust line numbers.
* gcc.dg/noncompile/950825-1.c: Expect incomplete type error message.
* gcc.dg/Wcxx-compat-8.c: Likewise.
* gcc.dg/pr51034.c: New test.
* gcc.dg/pr53196-1.c: New test.
* gcc.dg/pr53196-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188483 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr51034.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr51034.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr51034.c b/gcc/testsuite/gcc.dg/pr51034.c new file mode 100644 index 00000000000..c9b9c27c9cd --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr51034.c @@ -0,0 +1,14 @@ +/* PR c/51034 */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu99" } */ + +struct S; + +int +main () +{ + struct R { typeof (((struct W) {})) x; } r; /* { dg-error "invalid use of undefined type" } */ + struct S { typeof (((struct S) {})) x; } s; /* { dg-error "invalid use of undefined type" } */ + struct T { int x[sizeof ((struct T) {})]; } t;/* { dg-error "invalid use of undefined type" } */ + struct U { int x[sizeof((struct V){})];} u; /* { dg-error "invalid use of undefined type" } */ +} |