diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Sema/enum.c | 4 | ||||
-rw-r--r-- | clang/test/Sema/incomplete-decl.c | 4 | ||||
-rw-r--r-- | clang/test/Sema/init.c | 3 | ||||
-rw-r--r-- | clang/test/Sema/tentative-decls.c | 9 |
4 files changed, 13 insertions, 7 deletions
diff --git a/clang/test/Sema/enum.c b/clang/test/Sema/enum.c index 37c9a1e7cf9..dbc250abc3b 100644 --- a/clang/test/Sema/enum.c +++ b/clang/test/Sema/enum.c @@ -21,7 +21,9 @@ int test() { return sizeof(enum e) ; } -enum gccForwardEnumExtension ve; // expected-warning{{ISO C forbids forward references to 'enum' types}} +enum gccForwardEnumExtension ve; // expected-warning{{ISO C forbids forward references to 'enum' types}} \ +// expected-error{{tentative definition has type 'enum gccForwardEnumExtension' that is never completed}} \ +// expected-note{{forward declaration of 'enum gccForwardEnumExtension'}} int test2(int i) { diff --git a/clang/test/Sema/incomplete-decl.c b/clang/test/Sema/incomplete-decl.c index 7ec436acce8..de957403a3a 100644 --- a/clang/test/Sema/incomplete-decl.c +++ b/clang/test/Sema/incomplete-decl.c @@ -1,9 +1,9 @@ // RUN: clang -fsyntax-only -verify %s -struct foo; // expected-note 3 {{forward declaration of 'struct foo'}} +struct foo; // expected-note 4 {{forward declaration of 'struct foo'}} void b; // expected-error {{variable has incomplete type 'void'}} -struct foo f; // // FIXME: error because 'struct foo' is never defined +struct foo f; // expected-error{{tentative definition has type 'struct foo' that is never completed}} static void c; // expected-error {{variable has incomplete type 'void'}} static struct foo g; // expected-error {{variable has incomplete type 'struct foo'}} diff --git a/clang/test/Sema/init.c b/clang/test/Sema/init.c index 1f84e41eabf..6f592b80e60 100644 --- a/clang/test/Sema/init.c +++ b/clang/test/Sema/init.c @@ -74,7 +74,8 @@ int sym_fw1a_scr[] = { }; // PR3001 -struct s1 s2 = { +struct s1 s2 = { // expected-error{{tentative definition has type 'struct s1' that is never completed}} \ + // expected-note{{forward declaration of 'struct s1'}} .a = sizeof(struct s3), // expected-error {{invalid application of 'sizeof'}} \ // expected-note{{forward declaration of 'struct s3'}} .b = bogus // expected-error {{use of undeclared identifier 'bogus'}} diff --git a/clang/test/Sema/tentative-decls.c b/clang/test/Sema/tentative-decls.c index 3c1ab0e6587..23297f3a220 100644 --- a/clang/test/Sema/tentative-decls.c +++ b/clang/test/Sema/tentative-decls.c @@ -5,7 +5,10 @@ struct a x1; // expected-note 2{{forward declaration of 'struct a'}} static struct a x2; // expected-error{{variable has incomplete type 'struct a'}} struct a x3[10]; // expected-error{{array has incomplete element type 'struct a'}} struct a {int x;}; -struct b x4; // FIXME: error because 'struct b' is never defined +static struct a x2_okay; +struct a x3_okay[10]; +struct b x4; // expected-error{{tentative definition has type 'struct b' that is never completed}} \ + // expected-note{{forward declaration of 'struct b'}} const int a [1] = {1}; extern const int a[]; @@ -23,8 +26,8 @@ int i1; extern int i1; // expected-note {{previous definition is here}} static int i1; // expected-error{{static declaration of 'i1' follows non-static declaration}} -static int i2 = 5; // expected-note 2 {{previous definition is here}} -int i2 = 3; // expected-error{{redefinition of 'i2'}} expected-error{{non-static declaration of 'i2' follows static declaration}} +static int i2 = 5; // expected-note 1 {{previous definition is here}} +int i2 = 3; // expected-error{{non-static declaration of 'i2' follows static declaration}} __private_extern__ int pExtern; int pExtern = 0; |