1 // RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wno-gnu
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s -DNONE -Wno-gnu
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s -DNONE -Wno-gnu
5 // RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wgnu
6 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s -DALL -Wgnu
7 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s -DALL -Wgnu
9 // RUN: %clang_cc1 -fsyntax-only -verify %s -DALL -Wno-gnu \
10 // RUN: -Wgnu-anonymous-struct -Wredeclared-class-member \
11 // RUN: -Wgnu-flexible-array-union-member -Wgnu-folding-constant \
12 // RUN: -Wgnu-empty-struct
13 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s -DALL -Wno-gnu \
14 // RUN: -Wgnu-anonymous-struct -Wredeclared-class-member \
15 // RUN: -Wgnu-flexible-array-union-member -Wgnu-folding-constant \
16 // RUN: -Wgnu-empty-struct
17 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s -DALL -Wno-gnu \
18 // RUN: -Wgnu-anonymous-struct -Wredeclared-class-member \
19 // RUN: -Wgnu-flexible-array-union-member -Wgnu-folding-constant \
20 // RUN: -Wgnu-empty-struct
22 // RUN: %clang_cc1 -fsyntax-only -verify %s -DNONE -Wgnu \
23 // RUN: -Wno-gnu-anonymous-struct -Wno-redeclared-class-member \
24 // RUN: -Wno-gnu-flexible-array-union-member -Wno-gnu-folding-constant \
25 // RUN: -Wno-gnu-empty-struct
26 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s -DNONE -Wgnu \
27 // RUN: -Wno-gnu-anonymous-struct -Wno-redeclared-class-member \
28 // RUN: -Wno-gnu-flexible-array-union-member -Wno-gnu-folding-constant \
29 // RUN: -Wno-gnu-empty-struct
30 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s -DNONE -Wgnu \
31 // RUN: -Wno-gnu-anonymous-struct -Wno-redeclared-class-member \
32 // RUN: -Wno-gnu-flexible-array-union-member -Wno-gnu-folding-constant \
33 // RUN: -Wno-gnu-empty-struct
35 // Additional disabled tests:
36 // %clang_cc1 -fsyntax-only -verify %s -DANONYMOUSSTRUCT -Wno-gnu -Wgnu-anonymous-struct
37 // %clang_cc1 -fsyntax-only -verify %s -DREDECLAREDCLASSMEMBER -Wno-gnu -Wredeclared-class-member
38 // %clang_cc1 -fsyntax-only -verify %s -DFLEXIBLEARRAYUNIONMEMBER -Wno-gnu -Wgnu-flexible-array-union-member
39 // %clang_cc1 -fsyntax-only -verify %s -DFOLDINGCONSTANT -Wno-gnu -Wgnu-folding-constant
40 // %clang_cc1 -fsyntax-only -verify %s -DEMPTYSTRUCT -Wno-gnu -Wgnu-empty-struct
43 // expected-no-diagnostics
47 #if ALL || ANONYMOUSSTRUCT
48 // expected-warning@+5 {{anonymous structs are a GNU extension}}
60 #if ALL || REDECLAREDCLASSMEMBER
61 // expected-note@+6 {{previous declaration is here}}
62 // expected-warning@+6 {{class member cannot be redeclared}}
74 #if ALL || FLEXIBLEARRAYUNIONMEMBER
75 // expected-warning@+6 {{flexible array member 'c1' in a union is a GNU extension}}
86 #if (ALL || FOLDINGCONSTANT) && (__cplusplus <= 199711L) // C++03 or earlier modes
87 // expected-warning@+4 {{in-class initializer for static data member is not a constant expression; folding it to a constant is a GNU extension}}
91 static const int B
= int(0.75 * 1000 * 1000);
95 #if ALL || EMPTYSTRUCT
96 // expected-warning@+3 {{flexible array member 'a' in otherwise empty struct is a GNU extension}}
99 struct ofam
{int a
[];};