1 // RUN: %clang_cc1 %s -fsyntax-only -Wprivate-extern -verify
4 struct a x1
; // expected-note 2{{forward declaration of 'struct a'}}
5 static struct a x2
; // expected-warning{{tentative definition of variable with internal linkage has incomplete non-array type 'struct a'}}
6 struct a x3
[10]; // expected-error{{array has incomplete element type 'struct a'}}
8 static struct a x2_okay
;
10 struct b x4
; // expected-error{{tentative definition has type 'struct b' that is never completed}} \
11 // expected-note{{forward declaration of 'struct b'}}
13 const int a
[1] = {1};
17 const int b
[1] = {1};
19 extern const int c
[] = {1}; // expected-warning{{'extern' variable has an initializer}}
22 int i1
= 1; // expected-note {{previous definition is here}}
23 int i1
= 2; // expected-error {{redefinition of 'i1'}}
26 extern int i5
; // expected-note {{previous declaration is here}}
27 static int i5
; // expected-error{{static declaration of 'i5' follows non-static declaration}}
29 static int i2
= 5; // expected-note 1 {{previous definition is here}}
30 int i2
= 3; // expected-error{{non-static declaration of 'i2' follows static declaration}}
36 __private_extern__
int pExtern
; // expected-warning {{use of __private_extern__ on a declaration may not produce external symbol private to the linkage unit and is deprecated}} \
37 // expected-note {{use __attribute__((visibility("hidden"))) attribute instead}}
48 int redef
[]; // expected-note {{previous definition is here}}
49 int redef
[11]; // expected-error{{redefinition of 'redef'}}
52 extern int i6
; // expected-note {{previous declaration is here}}
53 static int i6
; // expected-error{{static declaration of 'i6' follows non-static declaration}}
62 // <rdar://problem/6808352>
66 static int a0
[] = { 4 };