// RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wno-gnu
// RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wgnu
// RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wno-gnu \
// RUN: -Wgnu-alignof-expression -Wgnu-case-range -Wgnu-complex-integer -Wgnu-conditional-omitted-operand \
// RUN: -Wgnu-empty-initializer -Wgnu-label-as-value -Wgnu-statement-expression \
// RUN: -Wgnu-compound-literal-initializer -Wgnu-flexible-array-initializer \
// RUN: -Wgnu-redeclared-enum -Wgnu-folding-constant -Wgnu-empty-struct \
// RUN: -Wgnu-union-cast -Wgnu-variable-sized-type-not-at-end
// RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wgnu \
// RUN: -Wno-gnu-alignof-expression -Wno-gnu-case-range -Wno-gnu-complex-integer -Wno-gnu-conditional-omitted-operand \
// RUN: -Wno-gnu-empty-initializer -Wno-gnu-label-as-value -Wno-gnu-statement-expression \
// RUN: -Wno-gnu-compound-literal-initializer -Wno-gnu-flexible-array-initializer \
// RUN: -Wno-gnu-redeclared-enum -Wno-gnu-folding-constant -Wno-gnu-empty-struct \
// RUN: -Wno-gnu-union-cast -Wno-gnu-variable-sized-type-not-at-end
// Additional disabled tests:
// %clang_cc1 -fsyntax-only -verify %s -DALIGNOF -Wno-gnu -Wgnu-alignof-expression
// %clang_cc1 -fsyntax-only -verify %s -DCASERANGE -Wno-gnu -Wgnu-case-range
// %clang_cc1 -fsyntax-only -verify %s -DCOMPLEXINT -Wno-gnu -Wgnu-complex-integer
// %clang_cc1 -fsyntax-only -verify %s -DOMITTEDOPERAND -Wno-gnu -Wgnu-conditional-omitted-operand
// %clang_cc1 -fsyntax-only -verify %s -DEMPTYINIT -Wno-gnu -Wgnu-empty-initializer
// %clang_cc1 -fsyntax-only -verify %s -DLABELVALUE -Wno-gnu -Wgnu-label-as-value
// %clang_cc1 -fsyntax-only -verify %s -DSTATEMENTEXP -Wno-gnu -Wgnu-statement-expression
// %clang_cc1 -fsyntax-only -verify %s -DSTATEMENTEXPMACRO -Wno-gnu -Wgnu-statement-expression-from-macro-expansion
// %clang_cc1 -fsyntax-only -verify %s -DCOMPOUNDLITERALINITIALIZER -Wno-gnu -Wgnu-compound-literal-initializer
// %clang_cc1 -fsyntax-only -verify %s -DFLEXIBLEARRAYINITIALIZER -Wno-gnu -Wgnu-flexible-array-initializer
// %clang_cc1 -fsyntax-only -verify %s -DREDECLAREDENUM -Wno-gnu -Wgnu-redeclared-enum
// %clang_cc1 -fsyntax-only -verify %s -DUNIONCAST -Wno-gnu -Wgnu-union-cast
// %clang_cc1 -fsyntax-only -verify %s -DVARIABLESIZEDTYPENOTATEND -Wno-gnu -Wgnu-variable-sized-type-not-at-end
// %clang_cc1 -fsyntax-only -verify %s -DFOLDINGCONSTANT -Wno-gnu -Wgnu-folding-constant
// %clang_cc1 -fsyntax-only -verify %s -DEMPTYSTRUCT -Wno-gnu -Wgnu-empty-struct
// expected-no-diagnostics
// expected-warning@+4 {{'_Alignof' applied to an expression is a GNU extension}}
char align;
;
// expected-warning@+5 {{use of GNU case range extension}}
void
// expected-warning@+3 {{complex integer types are a GNU extension}}
_Complex short int complexint;
// expected-warning@+3 {{use of GNU ?: conditional expression extension, omitting middle operand}}
static const char* omittedoperand = 0 ?: "Null";
// expected-warning@+3 {{use of GNU empty initializer extension}}
emptyinit = ;
// expected-warning@+6 {{use of GNU address-of-label extension}}
// expected-warning@+7 {{use of GNU indirect-goto extension}}
void
// expected-warning@+5 {{use of GNU statement expression extension}}
void
// expected-warning@+5 {{use of GNU statement expression extension from macro expansion}}
void
// expected-warning@+4 {{initialization of an array of type 'int[5]' from a compound literal of type 'int[5]' is a GNU extension}}
typedef int int5;
int cli = ;
// expected-note@+6 {{initialized flexible array member 'y' is here}}
// expected-warning@+6 {{flexible array initialization is a GNU extension}}
fai = ;
// expected-warning@+5 {{expression is not an integer constant expression; folding it to a constant is a GNU extension}}
// expected-warning@+7 {{variable length array folded to constant array as an extension}}
;
static const int size = 100;
int data;
void // OK, always a VLA
// expected-note@+4 {{previous definition is here}}
// expected-warning@+8 {{redeclaration of already-defined enum 'RE' is a GNU extension}}
;
;
// expected-warning@+4 {{cast to union type is a GNU extension}}
;
union uc w = 2;
// expected-warning@+8 {{field 'hdr' with variable sized type 'struct vst' not at the end of a struct or class is a GNU extension}}
;
;
// expected-warning@+4 {{empty struct is a GNU extension}}
// expected-warning@+4 {{struct without named members is a GNU extension}}
const es;
swnm;