Skip to content

Commit cb60e46

Browse files
committed
Change some tests' expected messages
Now that `= default` will be deleted when ill-formed when used as an extension
1 parent 0793795 commit cb60e46

File tree

3 files changed

+25
-61
lines changed

3 files changed

+25
-61
lines changed

clang/test/CXX/drs/dr16xx.cpp

Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -192,36 +192,24 @@ namespace cwg1658 { // cwg1658: 5
192192
struct E : A { E(); virtual void foo() = 0; }; // #cwg1658-E1
193193
E::E() = default; // #cwg1658-E1-ctor
194194
// cxx98-error@-1 {{defaulted function definitions are a C++11 extension}}
195-
// cxx98-error@-2 {{base class 'A' has private default constructor}}
196-
// cxx98-note@-3 {{in defaulted default constructor for 'cwg1658::DefCtor::E' first required here}}
197-
// cxx98-note@#cwg1658-A1 {{implicitly declared private here}}
198-
// since-cxx11-error@#cwg1658-E1-ctor {{defaulting this default constructor would delete it after its first declaration}}
199-
// since-cxx11-note@#cwg1658-E1 {{default constructor of 'E' is implicitly deleted because base class 'A' has an inaccessible default constructor}}
195+
// expected-error@#cwg1658-E1-ctor {{defaulting this default constructor would delete it after its first declaration}}
196+
// expected-note@#cwg1658-E1 {{default constructor of 'E' is implicitly deleted because base class 'A' has an inaccessible default constructor}}
200197
struct F : virtual A { F(); }; // #cwg1658-F1
201198
F::F() = default; // #cwg1658-F1-ctor
202199
// cxx98-error@-1 {{defaulted function definitions are a C++11 extension}}
203-
// cxx98-error@-2 {{inherited virtual base class 'A' has private default constructor}}
204-
// cxx98-note@-3 {{in defaulted default constructor for 'cwg1658::DefCtor::F' first required here}}
205-
// cxx98-note@#cwg1658-A1 {{implicitly declared private here}}
206-
// since-cxx11-error@#cwg1658-F1-ctor {{defaulting this default constructor would delete it after its first declaration}}
207-
// since-cxx11-note@#cwg1658-F1 {{default constructor of 'F' is implicitly deleted because base class 'A' has an inaccessible default constructor}}
200+
// expected-error@#cwg1658-F1-ctor {{defaulting this default constructor would delete it after its first declaration}}
201+
// expected-note@#cwg1658-F1 {{default constructor of 'F' is implicitly deleted because base class 'A' has an inaccessible default constructor}}
208202

209203
struct G : B { G(); virtual void foo() = 0; }; // #cwg1658-G1
210204
G::G() = default; // #cwg1658-G1-ctor
211205
// cxx98-error@-1 {{defaulted function definitions are a C++11 extension}}
212-
// cxx98-error@#cwg1658-G1 {{base class 'B' has private destructor}}
213-
// cxx98-note@#cwg1658-G1-ctor {{in defaulted default constructor for 'cwg1658::DefCtor::G' first required here}}
214-
// cxx98-note@#cwg1658-B1 {{implicitly declared private here}}
215-
// since-cxx11-error@#cwg1658-G1-ctor {{defaulting this default constructor would delete it after its first declaration}}
216-
// since-cxx11-note@#cwg1658-G1 {{default constructor of 'G' is implicitly deleted because base class 'B' has an inaccessible destructor}}
206+
// expected-error@#cwg1658-G1-ctor {{defaulting this default constructor would delete it after its first declaration}}
207+
// expected-note@#cwg1658-G1 {{default constructor of 'G' is implicitly deleted because base class 'B' has an inaccessible destructor}}
217208
struct H : virtual B { H(); }; // #cwg1658-H1
218209
H::H() = default; // #cwg1658-H1-ctor
219210
// cxx98-error@-1 {{defaulted function definitions are a C++11 extension}}
220-
// cxx98-error@#cwg1658-H1 {{base class 'B' has private destructor}}
221-
// cxx98-note@#cwg1658-H1-ctor {{in defaulted default constructor for 'cwg1658::DefCtor::H' first required here}}
222-
// cxx98-note@#cwg1658-B1 {{implicitly declared private here}}
223-
// since-cxx11-error@#cwg1658-H1-ctor {{defaulting this default constructor would delete it after its first declaration}}
224-
// since-cxx11-note@#cwg1658-H1 {{default constructor of 'H' is implicitly deleted because base class 'B' has an inaccessible destructor}}
211+
// expected-error@#cwg1658-H1-ctor {{defaulting this default constructor would delete it after its first declaration}}
212+
// expected-note@#cwg1658-H1 {{default constructor of 'H' is implicitly deleted because base class 'B' has an inaccessible destructor}}
225213
}
226214

227215
namespace Dtor {
@@ -234,19 +222,13 @@ namespace cwg1658 { // cwg1658: 5
234222
struct G : B { ~G(); virtual void foo() = 0; }; // #cwg1658-G2
235223
G::~G() = default; // #cwg1658-G2-dtor
236224
// cxx98-error@-1 {{defaulted function definitions are a C++11 extension}}
237-
// cxx98-error@#cwg1658-G2 {{base class 'B' has private destructor}}
238-
// cxx98-note@#cwg1658-G2-dtor {{in defaulted destructor for 'cwg1658::Dtor::G' first required here}}
239-
// cxx98-note@#cwg1658-B2 {{implicitly declared private here}}
240-
// since-cxx11-error@#cwg1658-G2-dtor {{defaulting this destructor would delete it after its first declaration}}
241-
// since-cxx11-note@#cwg1658-G2 {{destructor of 'G' is implicitly deleted because base class 'B' has an inaccessible destructor}}
225+
// expected-error@#cwg1658-G2-dtor {{defaulting this destructor would delete it after its first declaration}}
226+
// expected-note@#cwg1658-G2 {{destructor of 'G' is implicitly deleted because base class 'B' has an inaccessible destructor}}
242227
struct H : virtual B { ~H(); }; // #cwg1658-H2
243228
H::~H() = default; // #cwg1658-H2-dtor
244229
// cxx98-error@-1 {{defaulted function definitions are a C++11 extension}}
245-
// cxx98-error@#cwg1658-H2 {{base class 'B' has private destructor}}
246-
// cxx98-note@#cwg1658-H2-dtor {{in defaulted destructor for 'cwg1658::Dtor::H' first required here}}
247-
// cxx98-note@#cwg1658-B2 {{implicitly declared private here}}
248-
// since-cxx11-error@#cwg1658-H2-dtor {{defaulting this destructor would delete it after its first declaration}}
249-
// since-cxx11-note@#cwg1658-H2 {{destructor of 'H' is implicitly deleted because base class 'B' has an inaccessible destructor}}
230+
// expected-error@#cwg1658-H2-dtor {{defaulting this destructor would delete it after its first declaration}}
231+
// expected-note@#cwg1658-H2 {{destructor of 'H' is implicitly deleted because base class 'B' has an inaccessible destructor}}
250232
}
251233

252234
namespace MemInit {
@@ -291,36 +273,24 @@ namespace cwg1658 { // cwg1658: 5
291273
// cxx98-error@-1 {{rvalue references are a C++11 extension}}
292274
E::E(const E&) = default; // #cwg1658-E5-copy-ctor
293275
// cxx98-error@-1 {{defaulted function definitions are a C++11 extension}}
294-
// cxx98-error@-2 {{base class 'A' has private copy constructor}}
295-
// cxx98-note@-3 {{in defaulted copy constructor for 'cwg1658::CopyCtor::E' first required here}}
296-
// cxx98-note@#cwg1658-A5 {{implicitly declared private here}}
297-
// since-cxx11-error@#cwg1658-E5-copy-ctor {{defaulting this copy constructor would delete it after its first declaration}}
298-
// since-cxx11-note@#cwg1658-E5 {{copy constructor of 'E' is implicitly deleted because base class 'A' has an inaccessible copy constructor}}
276+
// expected-error@#cwg1658-E5-copy-ctor {{defaulting this copy constructor would delete it after its first declaration}}
277+
// expected-note@#cwg1658-E5 {{copy constructor of 'E' is implicitly deleted because base class 'A' has an inaccessible copy constructor}}
299278
E::E(E&&) = default; // #cwg1658-E5-move-ctor
300279
// cxx98-error@-1 {{rvalue references are a C++11 extension}}
301280
// cxx98-error@-2 {{defaulted function definitions are a C++11 extension}}
302-
// cxx98-error@-3 {{base class 'A' has private move constructor}}
303-
// cxx98-note@-4 {{in defaulted move constructor for 'cwg1658::CopyCtor::E' first required here}}
304-
// cxx98-note@#cwg1658-A5 {{implicitly declared private here}}
305-
// since-cxx11-error@#cwg1658-E5-move-ctor {{defaulting this move constructor would delete it after its first declaration}}
306-
// since-cxx11-note@#cwg1658-E5 {{move constructor of 'E' is implicitly deleted because base class 'A' has an inaccessible move constructor}}
281+
// expected-error@#cwg1658-E5-move-ctor {{defaulting this move constructor would delete it after its first declaration}}
282+
// expected-note@#cwg1658-E5 {{move constructor of 'E' is implicitly deleted because base class 'A' has an inaccessible move constructor}}
307283
struct F : virtual A { F(const F&); F(F&&); }; // #cwg1658-F5
308284
// cxx98-error@-1 {{rvalue references are a C++11 extension}}
309285
F::F(const F&) = default; // #cwg1658-F5-copy-ctor
310286
// cxx98-error@-1 {{defaulted function definitions are a C++11 extension}}
311-
// cxx98-error@-2 {{inherited virtual base class 'A' has private copy constructor}}
312-
// cxx98-note@-3 {{in defaulted copy constructor for 'cwg1658::CopyCtor::F' first required here}}
313-
// cxx98-note@#cwg1658-A5 {{implicitly declared private here}}
314-
// since-cxx11-error@#cwg1658-F5-copy-ctor {{defaulting this copy constructor would delete it after its first declaration}}
315-
// since-cxx11-note@#cwg1658-F5 {{copy constructor of 'F' is implicitly deleted because base class 'A' has an inaccessible copy constructor}}
287+
// expected-error@#cwg1658-F5-copy-ctor {{defaulting this copy constructor would delete it after its first declaration}}
288+
// expected-note@#cwg1658-F5 {{copy constructor of 'F' is implicitly deleted because base class 'A' has an inaccessible copy constructor}}
316289
F::F(F&&) = default; // #cwg1658-F5-move-ctor
317290
// cxx98-error@-1 {{rvalue references are a C++11 extension}}
318291
// cxx98-error@-2 {{defaulted function definitions are a C++11 extension}}
319-
// cxx98-error@-3 {{inherited virtual base class 'A' has private move constructor}}
320-
// cxx98-note@-4 {{in defaulted move constructor for 'cwg1658::CopyCtor::F' first required here}}
321-
// cxx98-note@#cwg1658-A5 {{implicitly declared private here}}
322-
// since-cxx11-error@#cwg1658-F5-move-ctor {{defaulting this move constructor would delete it after its first declaration}}
323-
// since-cxx11-note@#cwg1658-F5 {{move constructor of 'F' is implicitly deleted because base class 'A' has an inaccessible move constructor}}
292+
// expected-error@#cwg1658-F5-move-ctor {{defaulting this move constructor would delete it after its first declaration}}
293+
// expected-note@#cwg1658-F5 {{move constructor of 'F' is implicitly deleted because base class 'A' has an inaccessible move constructor}}
324294
}
325295

326296
// assignment case is superseded by cwg2180

clang/test/CXX/drs/dr21xx.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,19 +246,13 @@ namespace cwg2180 { // cwg2180: yes
246246
};
247247
B &B::operator=(const B&) = default; // #cwg2180-B-copy
248248
// cxx98-error@-1 {{defaulted function definitions are a C++11 extension}}
249-
// cxx98-error@-2 {{'operator=' is a private member of 'cwg2180::A'}}
250-
// cxx98-note@-3 {{in defaulted copy assignment operator for 'cwg2180::B' first required here}}
251-
// cxx98-note@#cwg2180-A-copy {{implicitly declared private here}}
252-
// since-cxx11-error@#cwg2180-B-copy {{defaulting this copy assignment operator would delete it after its first declaration}}
253-
// since-cxx11-note@#cwg2180-B {{copy assignment operator of 'B' is implicitly deleted because base class 'A' has an inaccessible copy assignment operator}}
249+
// expected-error@#cwg2180-B-copy {{defaulting this copy assignment operator would delete it after its first declaration}}
250+
// expected-note@#cwg2180-B {{copy assignment operator of 'B' is implicitly deleted because base class 'A' has an inaccessible copy assignment operator}}
254251
B &B::operator=(B&&) = default; // #cwg2180-B-move
255252
// cxx98-error@-1 {{rvalue references are a C++11 extension}}
256253
// cxx98-error@-2 {{defaulted function definitions are a C++11 extension}}
257-
// cxx98-error@-3 {{'operator=' is a private member of 'cwg2180::A'}}
258-
// cxx98-note@-4 {{in defaulted move assignment operator for 'cwg2180::B' first required here}}
259-
// cxx98-note@#cwg2180-A-move {{implicitly declared private here}}
260-
// since-cxx11-error@#cwg2180-B-move {{defaulting this move assignment operator would delete it after its first declaration}}
261-
// since-cxx11-note@#cwg2180-B {{move assignment operator of 'B' is implicitly deleted because base class 'A' has an inaccessible move assignment operator}}
254+
// expected-error@#cwg2180-B-move {{defaulting this move assignment operator would delete it after its first declaration}}
255+
// expected-note@#cwg2180-B {{move assignment operator of 'B' is implicitly deleted because base class 'A' has an inaccessible move assignment operator}}
262256
}
263257

264258
namespace cwg2199 { // cwg2199: 3.8

clang/test/SemaCXX/cxx0x-cursory-default-delete.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %clang_cc1 -std=c++03 -Wno-c++11-extensions -fsyntax-only -verify %s
33

44
#if __cplusplus < 201103L
5-
#define static_assert _Static_assert
5+
#define static_assert __extension__ _Static_assert
66
#define nullptr 0
77
#define noexcept throw()
88
#endif

0 commit comments

Comments
 (0)