blob: 7d36770f5d20f6ab51bddb605ffd73bab29c2515 [file] [log] [blame]
Richard Smith41be6732011-10-14 20:48:27 +00001// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat -verify %s
Richard Smithebaf0e62011-10-18 20:49:44 +00002// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s
Richard Smith84ef8992011-10-14 20:41:13 +00003
Richard Smith03544fc2012-04-19 06:58:00 +00004namespace std {
5 struct type_info;
6 using size_t = decltype(sizeof(0)); // expected-warning {{decltype}} expected-warning {{alias}}
7 template<typename T> struct initializer_list {
8 initializer_list(T*, size_t);
9 T *p;
10 size_t n;
Richard Smith193649c2013-01-12 01:05:20 +000011 T *begin();
12 T *end();
Richard Smith03544fc2012-04-19 06:58:00 +000013 };
14}
Richard Smithd390de92012-02-25 10:20:59 +000015
Richard Smith84ef8992011-10-14 20:41:13 +000016template<typename ...T> // expected-warning {{variadic templates are incompatible with C++98}}
17class Variadic1 {};
18
19template<template<typename> class ...T> // expected-warning {{variadic templates are incompatible with C++98}}
20class Variadic2 {};
21
22template<int ...I> // expected-warning {{variadic templates are incompatible with C++98}}
23class Variadic3 {};
Richard Smith41be6732011-10-14 20:48:27 +000024
Michael Hanf64231e2012-11-06 19:34:54 +000025alignas(8) int with_alignas; // expected-warning {{'alignas' is incompatible with C++98}}
Richard Smith41be6732011-10-14 20:48:27 +000026int with_attribute [[ ]]; // expected-warning {{attributes are incompatible with C++98}}
Richard Smith661a9962011-10-15 01:18:56 +000027
28void Literals() {
29 (void)u8"str"; // expected-warning {{unicode literals are incompatible with C++98}}
30 (void)u"str"; // expected-warning {{unicode literals are incompatible with C++98}}
31 (void)U"str"; // expected-warning {{unicode literals are incompatible with C++98}}
32 (void)u'x'; // expected-warning {{unicode literals are incompatible with C++98}}
33 (void)U'x'; // expected-warning {{unicode literals are incompatible with C++98}}
34
35 (void)u8R"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
36 (void)uR"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
37 (void)UR"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
38 (void)R"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
39 (void)LR"X(str)X"; // expected-warning {{raw string literals are incompatible with C++98}}
40}
41
42template<typename T> struct S {};
Richard Smith7fe62082011-10-15 05:09:34 +000043namespace TemplateParsing {
44 S<::S<void> > s; // expected-warning {{'<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98}}
45 S< ::S<void>> t; // expected-warning {{consecutive right angle brackets are incompatible with C++98 (use '> >')}}
46}
47
48void Lambda() {
Richard Smithb9c64d82012-02-16 20:41:22 +000049 []{}(); // expected-warning {{lambda expressions are incompatible with C++98}}
Richard Smith7fe62082011-10-15 05:09:34 +000050}
51
Richard Smith03544fc2012-04-19 06:58:00 +000052struct Ctor {
53 Ctor(int, char);
54 Ctor(double, long);
55};
56struct InitListCtor {
57 InitListCtor(std::initializer_list<bool>);
58};
59
Sebastian Redl3e280b52012-03-18 22:25:45 +000060int InitList(int i = {}) { // expected-warning {{generalized initializer lists are incompatible with C++98}} \
61 // expected-warning {{scalar initialized from empty initializer list is incompatible with C++98}}
Sebastian Redl56a04282012-02-11 23:51:08 +000062 (void)new int {}; // expected-warning {{generalized initializer lists are incompatible with C++98}} \
63 // expected-warning {{scalar initialized from empty initializer list is incompatible with C++98}}
Sebastian Redl6dc00f62012-02-12 18:41:05 +000064 (void)int{}; // expected-warning {{generalized initializer lists are incompatible with C++98}} \
65 // expected-warning {{scalar initialized from empty initializer list is incompatible with C++98}}
Richard Smith6b130222011-10-18 21:39:00 +000066 int x { 0 }; // expected-warning {{generalized initializer lists are incompatible with C++98}}
Richard Smithdbe01bb2012-02-26 23:49:01 +000067 S<int> s = {}; // ok, aggregate
68 s = {}; // expected-warning {{generalized initializer lists are incompatible with C++98}}
Richard Smith03544fc2012-04-19 06:58:00 +000069 std::initializer_list<int> xs = { 1, 2, 3 }; // expected-warning {{initialization of initializer_list object is incompatible with C++98}}
70 auto ys = { 1, 2, 3 }; // expected-warning {{initialization of initializer_list object is incompatible with C++98}} \
71 // expected-warning {{'auto' type specifier is incompatible with C++98}}
72 Ctor c1 = { 1, 2 }; // expected-warning {{constructor call from initializer list is incompatible with C++98}}
73 Ctor c2 = { 3.0, 4l }; // expected-warning {{constructor call from initializer list is incompatible with C++98}}
74 InitListCtor ilc = { true, false }; // expected-warning {{initialization of initializer_list object is incompatible with C++98}}
75 const int &r = { 0 }; // expected-warning {{reference initialized from initializer list is incompatible with C++98}}
76 struct { int a; const int &r; } rr = { 0, {{0}} }; // expected-warning {{reference initialized from initializer list is incompatible with C++98}}
Richard Smith6b130222011-10-18 21:39:00 +000077 return { 0 }; // expected-warning {{generalized initializer lists are incompatible with C++98}}
Richard Smith7fe62082011-10-15 05:09:34 +000078}
Sebastian Redlca893712012-03-20 21:24:03 +000079struct DelayedDefaultArgumentParseInitList {
80 void f(int i = {1}) { // expected-warning {{generalized initializer lists are incompatible with C++98}}
81 }
82};
Richard Smith7fe62082011-10-15 05:09:34 +000083
Richard Smith5cc2c6e2012-03-05 04:02:15 +000084int operator"" _hello(const char *); // expected-warning {{literal operators are incompatible with C++98}}
Richard Smith7fe62082011-10-15 05:09:34 +000085
86enum EnumFixed : int { // expected-warning {{enumeration types with a fixed underlying type are incompatible with C++98}}
87};
88
89enum class EnumScoped { // expected-warning {{scoped enumerations are incompatible with C++98}}
90};
91
92void Deleted() = delete; // expected-warning {{deleted function definitions are incompatible with C++98}}
93struct Defaulted {
94 Defaulted() = default; // expected-warning {{defaulted function definitions are incompatible with C++98}}
95};
96
97int &&RvalueReference = 0; // expected-warning {{rvalue references are incompatible with C++98}}
98struct RefQualifier {
99 void f() &; // expected-warning {{reference qualifiers on functions are incompatible with C++98}}
100};
101
102auto f() -> int; // expected-warning {{trailing return types are incompatible with C++98}}
103
104void RangeFor() {
105 int xs[] = {1, 2, 3};
106 for (int &a : xs) { // expected-warning {{range-based for loop is incompatible with C++98}}
107 }
Richard Smith193649c2013-01-12 01:05:20 +0000108 for (auto &b : {1, 2, 3}) {
109 // expected-warning@-1 {{range-based for loop is incompatible with C++98}}
110 // expected-warning@-2 {{'auto' type specifier is incompatible with C++98}}
111 // expected-warning@-3 {{initialization of initializer_list object is incompatible with C++98}}
Richard Smith25cf8ab2013-01-26 00:39:02 +0000112 // expected-warning@-4 {{reference initialized from initializer list is incompatible with C++98}}
Richard Smith193649c2013-01-12 01:05:20 +0000113 }
Richard Smith25cf8ab2013-01-26 00:39:02 +0000114 struct Agg { int a, b; } const &agg = { 1, 2 }; // expected-warning {{reference initialized from initializer list is incompatible with C++98}}
Richard Smith7fe62082011-10-15 05:09:34 +0000115}
116
117struct InClassInit {
118 int n = 0; // expected-warning {{in-class initialization of non-static data members is incompatible with C++98}}
119};
120
121struct OverrideControlBase {
122 virtual void f();
123 virtual void g();
124};
125struct OverrideControl final : OverrideControlBase { // expected-warning {{'final' keyword is incompatible with C++98}}
126 virtual void f() override; // expected-warning {{'override' keyword is incompatible with C++98}}
127 virtual void g() final; // expected-warning {{'final' keyword is incompatible with C++98}}
128};
129
130using AliasDecl = int; // expected-warning {{alias declarations are incompatible with C++98}}
131template<typename T> using AliasTemplate = T; // expected-warning {{alias declarations are incompatible with C++98}}
132
Richard Smithebaf0e62011-10-18 20:49:44 +0000133inline namespace InlineNS { // expected-warning {{inline namespaces are incompatible with C++98}}
Richard Smith7fe62082011-10-15 05:09:34 +0000134}
Richard Smith0aa86c02011-10-15 05:42:01 +0000135
136auto auto_deduction = 0; // expected-warning {{'auto' type specifier is incompatible with C++98}}
137int *p = new auto(0); // expected-warning {{'auto' type specifier is incompatible with C++98}}
Richard Smith841804b2011-10-17 23:06:20 +0000138
139const int align_of = alignof(int); // expected-warning {{alignof expressions are incompatible with C++98}}
140char16_t c16 = 0; // expected-warning {{'char16_t' type specifier is incompatible with C++98}}
141char32_t c32 = 0; // expected-warning {{'char32_t' type specifier is incompatible with C++98}}
142constexpr int const_expr = 0; // expected-warning {{'constexpr' specifier is incompatible with C++98}}
143decltype(const_expr) decl_type = 0; // expected-warning {{'decltype' type specifier is incompatible with C++98}}
Richard Smith39304fa2012-02-24 18:10:23 +0000144__decltype(const_expr) decl_type2 = 0; // ok
Richard Smith841804b2011-10-17 23:06:20 +0000145void no_except() noexcept; // expected-warning {{noexcept specifications are incompatible with C++98}}
146bool no_except_expr = noexcept(1 + 1); // expected-warning {{noexcept expressions are incompatible with C++98}}
147void *null = nullptr; // expected-warning {{'nullptr' is incompatible with C++98}}
148static_assert(true, "!"); // expected-warning {{static_assert declarations are incompatible with C++98}}
Richard Smithebaf0e62011-10-18 20:49:44 +0000149
Richard Smitha1366cb2012-04-27 19:33:05 +0000150// FIXME: Reintroduce this test if support for inheriting constructors is
151// implemented.
152#if 0
Richard Smithebaf0e62011-10-18 20:49:44 +0000153struct InhCtorBase {
154 InhCtorBase(int);
155};
156struct InhCtorDerived : InhCtorBase {
Richard Smitha1366cb2012-04-27 19:33:05 +0000157 using InhCtorBase::InhCtorBase; // xpected-warning {{inheriting constructors are incompatible with C++98}}
Richard Smithebaf0e62011-10-18 20:49:44 +0000158};
Richard Smitha1366cb2012-04-27 19:33:05 +0000159#endif
Richard Smithebaf0e62011-10-18 20:49:44 +0000160
161struct FriendMember {
162 static void MemberFn();
163 friend void FriendMember::MemberFn(); // expected-warning {{friend declaration naming a member of the declaring class is incompatible with C++98}}
164};
165
166struct DelegCtor {
167 DelegCtor(int) : DelegCtor() {} // expected-warning {{delegating constructors are incompatible with C++98}}
168 DelegCtor();
169};
170
171template<int n = 0> void DefaultFuncTemplateArg(); // expected-warning {{default template arguments for a function template are incompatible with C++98}}
172
173template<typename T> int TemplateFn(T) { return 0; }
174void LocalTemplateArg() {
175 struct S {};
176 TemplateFn(S()); // expected-warning {{local type 'S' as template argument is incompatible with C++98}}
177}
178struct {} obj_of_unnamed_type; // expected-note {{here}}
179int UnnamedTemplateArg = TemplateFn(obj_of_unnamed_type); // expected-warning {{unnamed type as template argument is incompatible with C++98}}
180
181namespace RedundantParensInAddressTemplateParam {
182 int n;
183 template<int*p> struct S {};
184 S<(&n)> s; // expected-warning {{redundant parentheses surrounding address non-type template argument are incompatible with C++98}}
185 S<(((&n)))> t; // expected-warning {{redundant parentheses surrounding address non-type template argument are incompatible with C++98}}
186}
187
188namespace TemplateSpecOutOfScopeNs {
189 template<typename T> struct S {}; // expected-note {{here}}
190}
191template<> struct TemplateSpecOutOfScopeNs::S<char> {}; // expected-warning {{class template specialization of 'S' outside namespace 'TemplateSpecOutOfScopeNs' is incompatible with C++98}}
192
193struct Typename {
194 template<typename T> struct Inner {};
195};
196typename ::Typename TypenameOutsideTemplate(); // expected-warning {{use of 'typename' outside of a template is incompatible with C++98}}
197Typename::template Inner<int> TemplateOutsideTemplate(); // expected-warning {{use of 'template' keyword outside of a template is incompatible with C++98}}
198
199struct TrivialButNonPOD {
200 int f(int);
201private:
202 int k;
203};
204void Ellipsis(int n, ...);
205void TrivialButNonPODThroughEllipsis() {
206 Ellipsis(1, TrivialButNonPOD()); // expected-warning {{passing object of trivial but non-POD type 'TrivialButNonPOD' through variadic function is incompatible with C++98}}
207}
208
209struct HasExplicitConversion {
210 explicit operator bool(); // expected-warning {{explicit conversion functions are incompatible with C++98}}
211};
Richard Smith6b130222011-10-18 21:39:00 +0000212
213struct Struct {};
214enum Enum { enum_val = 0 };
215struct BadFriends {
216 friend enum ::Enum; // expected-warning {{befriending enumeration type 'enum ::Enum' is incompatible with C++98}}
217 friend int; // expected-warning {{non-class friend type 'int' is incompatible with C++98}}
218 friend Struct; // expected-warning {{befriending 'Struct' without 'struct' keyword is incompatible with C++98}}
219};
220
221int n = {}; // expected-warning {{scalar initialized from empty initializer list is incompatible with C++98}}
Richard Smith77faa362011-10-19 00:07:01 +0000222
223class PrivateMember {
224 struct ImPrivate {};
225};
226template<typename T> typename T::ImPrivate SFINAEAccessControl(T t) { // expected-warning {{substitution failure due to access control is incompatible with C++98}} expected-note {{while substituting deduced template arguments into function template 'SFINAEAccessControl' [with T = PrivateMember]}}
227 return typename T::ImPrivate();
228}
229int SFINAEAccessControl(...) { return 0; }
230int CheckSFINAEAccessControl = SFINAEAccessControl(PrivateMember());
Richard Smith53e53512011-10-19 00:54:10 +0000231
232template<typename T>
233struct FriendRedefinition {
234 friend void Friend() {} // expected-warning {{friend function 'Friend' would be implicitly redefined in C++98}} expected-note {{previous}}
235};
236FriendRedefinition<int> FriendRedef1;
237FriendRedefinition<char> FriendRedef2; // expected-note {{requested here}}
Richard Smith83da2e72011-10-19 16:55:56 +0000238
239namespace CopyCtorIssues {
240 struct Private {
241 Private();
242 private:
243 Private(const Private&); // expected-note {{declared private here}}
244 };
245 struct NoViable {
246 NoViable();
247 NoViable(NoViable&); // expected-note {{not viable}}
248 };
249 struct Ambiguous {
250 Ambiguous();
251 Ambiguous(const Ambiguous &, int = 0); // expected-note {{candidate}}
252 Ambiguous(const Ambiguous &, double = 0); // expected-note {{candidate}}
253 };
Richard Smith6c4c36c2012-03-30 20:53:28 +0000254 struct Deleted {
255 Private p; // expected-note {{implicitly deleted}}
Richard Smith83da2e72011-10-19 16:55:56 +0000256 };
257
258 const Private &a = Private(); // expected-warning {{copying variable of type 'CopyCtorIssues::Private' when binding a reference to a temporary would invoke an inaccessible constructor in C++98}}
259 const NoViable &b = NoViable(); // expected-warning {{copying variable of type 'CopyCtorIssues::NoViable' when binding a reference to a temporary would find no viable constructor in C++98}}
260 const Ambiguous &c = Ambiguous(); // expected-warning {{copying variable of type 'CopyCtorIssues::Ambiguous' when binding a reference to a temporary would find ambiguous constructors in C++98}}
261 const Deleted &d = Deleted(); // expected-warning {{copying variable of type 'CopyCtorIssues::Deleted' when binding a reference to a temporary would invoke a deleted constructor in C++98}}
262}
Richard Smithe7d7c392011-10-19 20:41:51 +0000263
264namespace UnionOrAnonStructMembers {
265 struct NonTrivCtor {
Richard Smithac713512012-12-08 02:53:02 +0000266 NonTrivCtor(); // expected-note 2{{user-provided default constructor}}
Richard Smithe7d7c392011-10-19 20:41:51 +0000267 };
268 struct NonTrivCopy {
Richard Smithac713512012-12-08 02:53:02 +0000269 NonTrivCopy(const NonTrivCopy&); // expected-note 2{{user-provided copy constructor}}
Richard Smithe7d7c392011-10-19 20:41:51 +0000270 };
271 struct NonTrivDtor {
Richard Smithac713512012-12-08 02:53:02 +0000272 ~NonTrivDtor(); // expected-note 2{{user-provided destructor}}
Richard Smithe7d7c392011-10-19 20:41:51 +0000273 };
274 union BadUnion {
275 NonTrivCtor ntc; // expected-warning {{union member 'ntc' with a non-trivial constructor is incompatible with C++98}}
276 NonTrivCopy ntcp; // expected-warning {{union member 'ntcp' with a non-trivial copy constructor is incompatible with C++98}}
277 NonTrivDtor ntd; // expected-warning {{union member 'ntd' with a non-trivial destructor is incompatible with C++98}}
278 };
279 struct Wrap {
280 struct {
281 NonTrivCtor ntc; // expected-warning {{anonymous struct member 'ntc' with a non-trivial constructor is incompatible with C++98}}
282 NonTrivCopy ntcp; // expected-warning {{anonymous struct member 'ntcp' with a non-trivial copy constructor is incompatible with C++98}}
283 NonTrivDtor ntd; // expected-warning {{anonymous struct member 'ntd' with a non-trivial destructor is incompatible with C++98}}
284 };
285 };
Richard Smithb9c64d82012-02-16 20:41:22 +0000286 union WithStaticDataMember {
287 static constexpr double d = 0.0; // expected-warning {{static data member 'd' in union is incompatible with C++98}} expected-warning {{'constexpr' specifier is incompatible with C++98}}
288 static const int n = 0; // expected-warning {{static data member 'n' in union is incompatible with C++98}}
289 static int k; // expected-warning {{static data member 'k' in union is incompatible with C++98}}
290 };
Richard Smithe7d7c392011-10-19 20:41:51 +0000291}
Richard Smith95aafb22011-10-20 03:28:47 +0000292
293int EnumNNS = Enum::enum_val; // expected-warning {{enumeration type in nested name specifier is incompatible with C++98}}
294template<typename T> void EnumNNSFn() {
295 int k = T::enum_val; // expected-warning {{enumeration type in nested name specifier is incompatible with C++98}}
296};
297template void EnumNNSFn<Enum>(); // expected-note {{in instantiation}}
Richard Smith0e9e9812011-10-20 21:42:12 +0000298
299void JumpDiagnostics(int n) {
300 goto DirectJump; // expected-warning {{goto would jump into protected scope in C++98}}
301 TrivialButNonPOD tnp1; // expected-note {{jump bypasses initialization of non-POD variable}}
302
303DirectJump:
304 void *Table[] = {&&DirectJump, &&Later};
305 goto *Table[n]; // expected-warning {{indirect goto might cross protected scopes in C++98}}
306
307 TrivialButNonPOD tnp2; // expected-note {{jump bypasses initialization of non-POD variable}}
308Later: // expected-note {{possible target of indirect goto}}
309 switch (n) {
310 TrivialButNonPOD tnp3; // expected-note {{jump bypasses initialization of non-POD variable}}
311 default: // expected-warning {{switch case would be in a protected scope in C++98}}
312 return;
313 }
314}
Richard Smithd390de92012-02-25 10:20:59 +0000315
316namespace UnevaluatedMemberAccess {
317 struct S {
318 int n;
319 int f() { return sizeof(S::n); } // ok
320 };
321 int k = sizeof(S::n); // expected-warning {{use of non-static data member 'n' in an unevaluated context is incompatible with C++98}}
322 const std::type_info &ti = typeid(S::n); // expected-warning {{use of non-static data member 'n' in an unevaluated context is incompatible with C++98}}
323}
Richard Smith26b75c02012-03-09 22:27:51 +0000324
325namespace LiteralUCNs {
326 char c1 = '\u001e'; // expected-warning {{universal character name referring to a control character is incompatible with C++98}}
327 wchar_t c2 = L'\u0041'; // expected-warning {{specifying character 'A' with a universal character name is incompatible with C++98}}
328 const char *s1 = "foo\u0031"; // expected-warning {{specifying character '1' with a universal character name is incompatible with C++98}}
329 const wchar_t *s2 = L"bar\u0085"; // expected-warning {{universal character name referring to a control character is incompatible with C++98}}
330}
Richard Smithb4051e72012-04-04 21:11:30 +0000331
332namespace NonTypeTemplateArgs {
333 template<typename T, T v> struct S {};
334 const int k = 5; // expected-note {{here}}
335 static void f() {} // expected-note {{here}}
336 S<const int&, k> s1; // expected-warning {{non-type template argument referring to object 'k' with internal linkage is incompatible with C++98}}
337 S<void(&)(), f> s2; // expected-warning {{non-type template argument referring to function 'f' with internal linkage is incompatible with C++98}}
338}
Richard Smith86e6fdc2012-04-26 01:51:03 +0000339
Richard Smith86e6fdc2012-04-26 01:51:03 +0000340namespace NullPointerTemplateArg {
341 struct A {};
342 template<int*> struct X {};
343 template<int A::*> struct Y {};
344 X<(int*)0> x; // expected-warning {{use of null pointer as non-type template argument is incompatible with C++98}}
345 Y<(int A::*)0> y; // expected-warning {{use of null pointer as non-type template argument is incompatible with C++98}}
346}
Benjamin Kramer2cd7f412012-07-30 15:53:26 +0000347
348namespace PR13480 {
349 struct basic_iterator {
Richard Smithac713512012-12-08 02:53:02 +0000350 basic_iterator(const basic_iterator &it) {} // expected-note {{because type 'PR13480::basic_iterator' has a user-provided copy constructor}}
351 basic_iterator(basic_iterator &it) {}
Benjamin Kramer2cd7f412012-07-30 15:53:26 +0000352 };
353
354 union test {
355 basic_iterator it; // expected-warning {{union member 'it' with a non-trivial copy constructor is incompatible with C++98}}
356 };
357}
Benjamin Kramere5e8f4d2012-07-30 16:41:40 +0000358
359namespace AssignOpUnion {
360 struct a {
Richard Smithac713512012-12-08 02:53:02 +0000361 void operator=(const a &it) {} // expected-note {{because type 'AssignOpUnion::a' has a user-provided copy assignment operator}}
362 void operator=(a &it) {}
Benjamin Kramere5e8f4d2012-07-30 16:41:40 +0000363 };
364
365 struct b {
Richard Smithac713512012-12-08 02:53:02 +0000366 void operator=(const b &it) {} // expected-note {{because type 'AssignOpUnion::b' has a user-provided copy assignment operator}}
Benjamin Kramere5e8f4d2012-07-30 16:41:40 +0000367 };
368
369 union test1 {
370 a x; // expected-warning {{union member 'x' with a non-trivial copy assignment operator is incompatible with C++98}}
371 b y; // expected-warning {{union member 'y' with a non-trivial copy assignment operator is incompatible with C++98}}
372 };
373}
Douglas Gregorccc4f282012-08-30 21:47:37 +0000374
375namespace rdar11736429 {
Richard Smithac713512012-12-08 02:53:02 +0000376 struct X { // expected-note {{because type 'rdar11736429::X' has no default constructor}}
Douglas Gregorccc4f282012-08-30 21:47:37 +0000377 X(const X&) = delete; // expected-warning{{deleted function definitions are incompatible with C++98}} \
Richard Smithac713512012-12-08 02:53:02 +0000378 // expected-note {{implicit default constructor suppressed by user-declared constructor}}
Douglas Gregorccc4f282012-08-30 21:47:37 +0000379 };
380
381 union S {
382 X x; // expected-warning{{union member 'x' with a non-trivial constructor is incompatible with C++98}}
383 };
384}