| 1 |
// RUN: %clang_cc1 -Wmissing-variable-declarations -fsyntax-only -verify %s |
| 2 |
|
| 3 |
int vbad1; // expected-warning{{no previous extern declaration for non-static variable 'vbad1'}} |
| 4 |
// expected-note@-1{{declare 'static' if the variable is not intended to be used outside of this translation unit}} |
| 5 |
|
| 6 |
int vbad2; |
| 7 |
int vbad2 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad2'}} |
| 8 |
// expected-note@-1{{declare 'static' if the variable is not intended to be used outside of this translation unit}} |
| 9 |
|
| 10 |
struct { // expected-note{{declare 'static' if the variable is not intended to be used outside of this translation unit}} |
| 11 |
int mgood1; |
| 12 |
} vbad3; // expected-warning{{no previous extern declaration for non-static variable 'vbad3'}} |
| 13 |
|
| 14 |
int vbad4; |
| 15 |
int vbad4 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad4'}} |
| 16 |
// expected-note@-1{{declare 'static' if the variable is not intended to be used outside of this translation unit}} |
| 17 |
extern int vbad4; |
| 18 |
|
| 19 |
extern int vgood1; |
| 20 |
int vgood1; |
| 21 |
int vgood1 = 10; |