// RUN: %clang_cc1 -isystem %S/Inputs -fsyntax-only -verify -Wreserved-identifier -Wno-visibility %s
// no-warning
void
int // no-warning
static int // expected-warning {{identifier '_bar' is reserved because it starts with '_' at global scope}}
static int // expected-warning {{identifier '_Bar' is reserved because it starts with '_' followed by a capital letter}}
int // expected-warning {{identifier '_foo' is reserved because it starts with '_' at global scope}}
// This one is explicitly skipped by -Wreserved-identifier
void *_; // no-warning
void
void // no-warning
;
;
; // expected-warning {{identifier '_Zebulon' is reserved because it starts with '_' followed by a capital letter}}
* p;
struct _Zebulon3 *pp; // expected-warning {{identifier '_Zebulon3' is reserved because it starts with '_' followed by a capital letter}}
typedef struct _Typedef; // expected-warning {{identifier '_Typedef' is reserved because it starts with '_' followed by a capital letter}}
int
// FIXME: According to clang declaration context layering, _preserved belongs to
// the translation unit, so we emit a warning. It's unclear that's what the
// standard mandate, but it's such a corner case we can live with it.
void // expected-warning {{identifier '_preserved' is reserved because it starts with '_' at global scope}}
extern char *; // expected-warning {{identifier '_strdup' is reserved because it starts with '_' at global scope}}
// Don't warn on redeclaration
extern char *; // no-warning
void