-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lit Test] Make tests C++11 compatible - Microsoft diagnostics
Differential Revision: https://reviews.llvm.org/D29520 llvm-svn: 294225
- llvmorg-20-init
- llvmorg-19.1.7
- llvmorg-19.1.6
- llvmorg-19.1.5
- llvmorg-19.1.4
- llvmorg-19.1.3
- llvmorg-19.1.2
- llvmorg-19.1.1
- llvmorg-19.1.0
- llvmorg-19.1.0-rc4
- llvmorg-19.1.0-rc3
- llvmorg-19.1.0-rc2
- llvmorg-19.1.0-rc1
- llvmorg-19-init
- llvmorg-18.1.8
- llvmorg-18.1.7
- llvmorg-18.1.6
- llvmorg-18.1.5
- llvmorg-18.1.4
- llvmorg-18.1.3
- llvmorg-18.1.2
- llvmorg-18.1.1
- llvmorg-18.1.0
- llvmorg-18.1.0-rc4
- llvmorg-18.1.0-rc3
- llvmorg-18.1.0-rc2
- llvmorg-18.1.0-rc1
- llvmorg-18-init
- llvmorg-17.0.6
- llvmorg-17.0.5
- llvmorg-17.0.4
- llvmorg-17.0.3
- llvmorg-17.0.2
- llvmorg-17.0.1
- llvmorg-17.0.0
- llvmorg-17.0.0-rc4
- llvmorg-17.0.0-rc3
- llvmorg-17.0.0-rc2
- llvmorg-17.0.0-rc1
- llvmorg-17-init
- llvmorg-16.0.6
- llvmorg-16.0.5
- llvmorg-16.0.4
- llvmorg-16.0.3
- llvmorg-16.0.2
- llvmorg-16.0.1
- llvmorg-16.0.0
- llvmorg-16.0.0-rc4
- llvmorg-16.0.0-rc3
- llvmorg-16.0.0-rc2
- llvmorg-16.0.0-rc1
- llvmorg-16-init
- llvmorg-15.0.7
- llvmorg-15.0.6
- llvmorg-15.0.5
- llvmorg-15.0.4
- llvmorg-15.0.3
- llvmorg-15.0.2
- llvmorg-15.0.1
- llvmorg-15.0.0
- llvmorg-15.0.0-rc3
- llvmorg-15.0.0-rc2
- llvmorg-15.0.0-rc1
- llvmorg-15-init
- llvmorg-14.0.6
- llvmorg-14.0.5
- llvmorg-14.0.4
- llvmorg-14.0.3
- llvmorg-14.0.2
- llvmorg-14.0.1
- llvmorg-14.0.0
- llvmorg-14.0.0-rc4
- llvmorg-14.0.0-rc3
- llvmorg-14.0.0-rc2
- llvmorg-14.0.0-rc1
- llvmorg-14-init
- llvmorg-13.0.1
- llvmorg-13.0.1-rc3
- llvmorg-13.0.1-rc2
- llvmorg-13.0.1-rc1
- llvmorg-13.0.0
- llvmorg-13.0.0-rc4
- llvmorg-13.0.0-rc3
- llvmorg-13.0.0-rc2
- llvmorg-13.0.0-rc1
- llvmorg-13-init
- llvmorg-12.0.1
- llvmorg-12.0.1-rc4
- llvmorg-12.0.1-rc3
- llvmorg-12.0.1-rc2
- llvmorg-12.0.1-rc1
- llvmorg-12.0.0
- llvmorg-12.0.0-rc5
- llvmorg-12.0.0-rc4
- llvmorg-12.0.0-rc3
- llvmorg-12.0.0-rc2
- llvmorg-12.0.0-rc1
- llvmorg-12-init
- llvmorg-11.1.0
- llvmorg-11.1.0-rc3
- llvmorg-11.1.0-rc2
- llvmorg-11.1.0-rc1
- llvmorg-11.0.1
- llvmorg-11.0.1-rc2
- llvmorg-11.0.1-rc1
- llvmorg-11.0.0
- llvmorg-11.0.0-rc6
- llvmorg-11.0.0-rc5
- llvmorg-11.0.0-rc4
- llvmorg-11.0.0-rc3
- llvmorg-11.0.0-rc2
- llvmorg-11.0.0-rc1
- llvmorg-11-init
- llvmorg-10.0.1
- llvmorg-10.0.1-rc4
- llvmorg-10.0.1-rc3
- llvmorg-10.0.1-rc2
- llvmorg-10.0.1-rc1
- llvmorg-10.0.0
- llvmorg-10.0.0-rc6
- llvmorg-10.0.0-rc5
- llvmorg-10.0.0-rc4
- llvmorg-10.0.0-rc3
- llvmorg-10.0.0-rc2
- llvmorg-10.0.0-rc1
- llvmorg-10-init
- llvmorg-9.0.1
- llvmorg-9.0.1-rc3
- llvmorg-9.0.1-rc2
- llvmorg-9.0.1-rc1
- llvmorg-9.0.0
- llvmorg-9.0.0-rc6
- llvmorg-9.0.0-rc5
- llvmorg-9.0.0-rc4
- llvmorg-9.0.0-rc3
- llvmorg-9.0.0-rc2
- llvmorg-9.0.0-rc1
- llvmorg-8.0.1
- llvmorg-8.0.1-rc4
- llvmorg-8.0.1-rc3
- llvmorg-8.0.1-rc2
- llvmorg-8.0.1-rc1
- llvmorg-8.0.0
- llvmorg-8.0.0-rc5
- llvmorg-8.0.0-rc4
- llvmorg-8.0.0-rc3
- llvmorg-8.0.0-rc2
- llvmorg-8.0.0-rc1
- llvmorg-7.1.0
- llvmorg-7.1.0-rc1
- llvmorg-7.0.1
- llvmorg-7.0.1-rc3
- llvmorg-7.0.1-rc2
- llvmorg-7.0.1-rc1
- llvmorg-7.0.0
- llvmorg-7.0.0-rc3
- llvmorg-7.0.0-rc2
- llvmorg-7.0.0-rc1
- llvmorg-6.0.1
- llvmorg-6.0.1-rc3
- llvmorg-6.0.1-rc2
- llvmorg-6.0.1-rc1
- llvmorg-6.0.0
- llvmorg-6.0.0-rc3
- llvmorg-6.0.0-rc2
- llvmorg-6.0.0-rc1
- llvmorg-5.0.2
- llvmorg-5.0.2-rc2
- llvmorg-5.0.2-rc1
- llvmorg-5.0.1
- llvmorg-5.0.1-rc3
- llvmorg-5.0.1-rc2
- llvmorg-5.0.1-rc1
- llvmorg-5.0.0
- llvmorg-5.0.0-rc5
- llvmorg-5.0.0-rc4
- llvmorg-5.0.0-rc3
- llvmorg-5.0.0-rc2
- llvmorg-5.0.0-rc1
Charles Li
committed
Feb 6, 2017
1 parent
e8a7b98
commit 11d0b8d
Showing
4 changed files
with
293 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,87 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -triple %itanium_abi_triple -verify %s | ||
// RUN: %clang_cc1 -fsyntax-only -triple %itanium_abi_triple -verify -std=c++98 %s | ||
// RUN: %clang_cc1 -fsyntax-only -triple %itanium_abi_triple -verify -std=c++11 %s | ||
// RUN: %clang_cc1 -fsyntax-only -triple %ms_abi_triple -DMSABI -verify %s | ||
// RUN: %clang_cc1 -fsyntax-only -triple %ms_abi_triple -DMSABI -verify -std=c++98 %s | ||
// RUN: %clang_cc1 -fsyntax-only -triple %ms_abi_triple -DMSABI -verify -std=c++11 %s | ||
|
||
struct A { | ||
virtual ~A(); | ||
#if __cplusplus >= 201103L | ||
// expected-note@-2 3 {{overridden virtual function is here}} | ||
#endif | ||
}; | ||
|
||
struct B : A { // expected-error {{no suitable member 'operator delete' in 'B'}} | ||
struct B : A { | ||
#if __cplusplus <= 199711L | ||
// expected-error@-2 {{no suitable member 'operator delete' in 'B'}} | ||
#else | ||
// expected-error@-4 {{deleted function '~B' cannot override a non-deleted function}} | ||
// expected-note@-5 {{virtual destructor requires an unambiguous, accessible 'operator delete'}} | ||
#ifdef MSABI | ||
// expected-note@-7 {{virtual destructor requires an unambiguous, accessible 'operator delete'}} | ||
#endif | ||
#endif | ||
virtual void f(); | ||
|
||
void operator delete (void *, int); // expected-note {{'operator delete' declared here}} | ||
void operator delete (void *, int); | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{'operator delete' declared here}} | ||
#endif | ||
}; | ||
|
||
#ifdef MSABI | ||
B b; // expected-note {{implicit destructor for 'B' first required here}} | ||
B b; | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{implicit destructor for 'B' first required here}} | ||
#else | ||
// expected-error@-4 {{attempt to use a deleted function}} | ||
#endif | ||
|
||
#else | ||
void B::f() { // expected-note {{implicit destructor for 'B' first required here}} | ||
void B::f() { | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{implicit destructor for 'B' first required here}} | ||
#endif | ||
} | ||
#endif | ||
|
||
struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}} | ||
struct C : A { | ||
#if __cplusplus <= 199711L | ||
// expected-error@-2 {{no suitable member 'operator delete' in 'C'}} | ||
#else | ||
// expected-error@-4 {{deleted function '~C' cannot override a non-deleted function}} | ||
// expected-note@-5 {{virtual destructor requires an unambiguous, accessible 'operator delete'}} | ||
#endif | ||
|
||
C(); | ||
void operator delete(void *, int); // expected-note {{'operator delete' declared here}} | ||
void operator delete(void *, int); | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{'operator delete' declared here}} | ||
#endif | ||
}; | ||
|
||
C::C() { } // expected-note {{implicit destructor for 'C' first required here}} | ||
C::C() { } | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{implicit destructor for 'C' first required here}} | ||
#endif | ||
|
||
struct D : A { // expected-error {{no suitable member 'operator delete' in 'D'}} | ||
void operator delete(void *, int); // expected-note {{'operator delete' declared here}} | ||
struct D : A { | ||
#if __cplusplus <= 199711L | ||
// expected-error@-2 {{no suitable member 'operator delete' in 'D'}} | ||
#else | ||
// expected-error@-4 {{deleted function '~D' cannot override a non-deleted function}} | ||
// expected-note@-5 {{virtual destructor requires an unambiguous, accessible 'operator delete'}} | ||
#endif | ||
void operator delete(void *, int); | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{'operator delete' declared here}} | ||
#endif | ||
}; | ||
|
||
void f() { | ||
new D; // expected-note {{implicit destructor for 'D' first required here}} | ||
new D; | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{implicit destructor for 'D' first required here}} | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,215 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -triple %itanium_abi_triple -verify %s | ||
// RUN: %clang_cc1 -fsyntax-only -triple %itanium_abi_triple -verify -std=c++98 %s | ||
// RUN: %clang_cc1 -fsyntax-only -triple %itanium_abi_triple -verify -std=c++11 %s | ||
// RUN: %clang_cc1 -fsyntax-only -triple %ms_abi_triple -DMSABI -verify %s | ||
// RUN: %clang_cc1 -fsyntax-only -triple %ms_abi_triple -DMSABI -verify -std=c++98 %s | ||
// RUN: %clang_cc1 -fsyntax-only -triple %ms_abi_triple -DMSABI -verify -std=c++11 %s | ||
// PR7800 | ||
|
||
// The Microsoft ABI doesn't have the concept of key functions, so we have different | ||
// expectations about when functions are first required for that case. | ||
|
||
class NoDestroy { ~NoDestroy(); }; | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 3 {{declared private here}} | ||
#ifdef MSABI | ||
// expected-note@+2 3 {{declared private here}} | ||
// expected-note@-4 3 {{declared private here}} | ||
#endif | ||
class NoDestroy { ~NoDestroy(); }; // expected-note 3 {{declared private here}} | ||
#endif | ||
|
||
struct A { | ||
virtual ~A(); | ||
#if __cplusplus >= 201103L | ||
// expected-note@-2 3 {{overridden virtual function is here}} | ||
#endif | ||
}; | ||
|
||
struct B : public virtual A { | ||
#if __cplusplus >= 201103L | ||
// expected-error@-2 {{deleted function '~B' cannot override a non-deleted function}} | ||
// expected-note@-3 {{overridden virtual function is here}} | ||
#endif | ||
|
||
NoDestroy x; | ||
#if __cplusplus <= 199711L | ||
// expected-error@-2 {{field of type 'NoDestroy' has private destructor}} | ||
#ifdef MSABI | ||
// expected-error@+3 {{field of type 'NoDestroy' has private destructor}} | ||
// expected-error@-4 {{field of type 'NoDestroy' has private destructor}} | ||
#endif | ||
struct B : public virtual A { | ||
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}} | ||
}; | ||
#else | ||
// expected-note@-7 {{destructor of 'B' is implicitly deleted because field 'x' has an inaccessible destructor}} | ||
#ifdef MSABI | ||
// expected-note@+3 {{implicit default constructor for 'B' first required here}} | ||
// expected-note@+2 {{implicit destructor for 'B' first required here}} | ||
// expected-note@-9 {{default constructor of 'B' is implicitly deleted because field 'x' has an inaccessible destructor}} | ||
#endif | ||
#endif | ||
}; | ||
|
||
struct D : public virtual B { | ||
#if __cplusplus <= 199711L | ||
#ifdef MSABI | ||
// expected-note@-3 {{implicit default constructor for 'B' first required here}} | ||
// expected-note@-4 {{implicit destructor for 'B' first required here}} | ||
#endif | ||
#else | ||
#ifdef MSABI | ||
// expected-note@-8 {{default constructor of 'D' is implicitly deleted because base class 'B' has a deleted default constructor}} | ||
#endif | ||
#endif | ||
virtual void foo(); | ||
~D(); | ||
#if __cplusplus >= 201103L | ||
//expected-error@-2 {{non-deleted function '~D' cannot override a deleted function}} | ||
#endif | ||
}; | ||
|
||
#ifdef MSABI | ||
D d; // expected-note {{implicit default constructor for 'D' first required here}} | ||
D d; | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{implicit default constructor for 'D' first required here}} | ||
#else | ||
void D::foo() { // expected-note {{implicit destructor for 'B' first required here}} | ||
// expected-error@-4 {{call to implicitly-deleted default constructor of 'D'}} | ||
#endif | ||
#else | ||
void D::foo() { | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{implicit destructor for 'B' first required here}} | ||
#endif | ||
} | ||
#endif | ||
|
||
struct E : public virtual A { | ||
#if __cplusplus >= 201103L | ||
// expected-error@-2 {{deleted function '~E' cannot override a non-deleted function}} | ||
// expected-note@-3 {{overridden virtual function is here}} | ||
#endif | ||
|
||
NoDestroy x; | ||
#if __cplusplus <= 199711L | ||
// expected-error@-2 {{field of type 'NoDestroy' has private destructor}} | ||
#ifdef MSABI | ||
// expected-error@+3 {{field of type 'NoDestroy' has private destructor}} | ||
// expected-error@-4 {{field of type 'NoDestroy' has private destructor}} | ||
#endif | ||
struct E : public virtual A { | ||
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}} | ||
}; | ||
#else | ||
// expected-note@-7 {{destructor of 'E' is implicitly deleted because field 'x' has an inaccessible destructor}} | ||
#ifdef MSABI | ||
// expected-note@+2 {{implicit default constructor for 'E' first required here}} | ||
// expected-note@-9 {{default constructor of 'E' is implicitly deleted because field 'x' has an inaccessible destructor}} | ||
#endif | ||
#endif | ||
struct F : public E { // expected-note {{implicit destructor for 'E' first required here}} | ||
}; | ||
|
||
struct F : public E { | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{implicit destructor for 'E' first required here}} | ||
#ifdef MSABI | ||
// expected-note@+2 {{implicit default constructor for 'F' first required here}} | ||
// expected-note@-4 {{implicit default constructor for 'E' first required here}} | ||
#endif | ||
#else | ||
// expected-error@-7 {{non-deleted function '~F' cannot override a deleted function}} | ||
// expected-note@-8 {{overridden virtual function is here}} | ||
#ifdef MSABI | ||
// expected-note@-10 {{default constructor of 'F' is implicitly deleted because base class 'E' has a deleted default constructor}} | ||
#endif | ||
#endif | ||
}; | ||
|
||
|
||
struct G : public virtual F { | ||
#ifdef MSABI | ||
#if __cplusplus <= 199711L | ||
// expected-note@-3 {{implicit default constructor for 'F' first required here}} | ||
#else | ||
// expected-note@-5 {{default constructor of 'G' is implicitly deleted because base class 'F' has a deleted default constructor}} | ||
#endif | ||
#endif | ||
|
||
virtual void foo(); | ||
~G(); | ||
#if __cplusplus >= 201103L | ||
//expected-error@-2 {{non-deleted function '~G' cannot override a deleted function}} | ||
#endif | ||
}; | ||
|
||
#ifdef MSABI | ||
G g; // expected-note {{implicit default constructor for 'G' first required here}} | ||
G g; | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{implicit default constructor for 'G' first required here}} | ||
#else | ||
// expected-error@-4 {{call to implicitly-deleted default constructor of 'G'}} | ||
#endif | ||
#else | ||
void G::foo() { // expected-note {{implicit destructor for 'F' first required here}} | ||
void G::foo() { | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{implicit destructor for 'F' first required here}} | ||
#endif | ||
} | ||
#endif | ||
|
||
struct H : public virtual A { | ||
#if __cplusplus >= 201103L | ||
// expected-error@-2 {{deleted function '~H' cannot override a non-deleted function}} | ||
// expected-note@-3 {{overridden virtual function is here}} | ||
#else | ||
#ifdef MSABI | ||
// expected-note@+3 {{'H' declared here}} | ||
// expected-error@+3 {{field of type 'NoDestroy' has private destructor}} | ||
// expected-note@-6 {{'H' declared here}} | ||
#endif | ||
struct H : public virtual A { | ||
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}} | ||
}; | ||
#endif | ||
|
||
NoDestroy x; | ||
#if __cplusplus <= 199711L | ||
// expected-error@-2 {{field of type 'NoDestroy' has private destructor}} | ||
#ifdef MSABI | ||
// expected-error@+3 {{implicit default constructor for 'I' must explicitly initialize the base class 'H' which does not have a default constructor}} | ||
// expected-note@+2 {{implicit destructor for 'H' first required here}} | ||
// expected-error@-4 {{field of type 'NoDestroy' has private destructor}} | ||
#endif | ||
#else | ||
// expected-note@-7 {{destructor of 'H' is implicitly deleted because field 'x' has an inaccessible destructor}} | ||
#ifdef MSABI | ||
// expected-note@-9 {{default constructor of 'H' is implicitly deleted because field 'x' has an inaccessible destructor}} | ||
#endif | ||
#endif | ||
}; | ||
|
||
struct I : public virtual H { | ||
#ifdef MSABI | ||
#if __cplusplus <= 199711L | ||
// expected-error@-3 {{implicit default constructor for 'I' must explicitly initialize the base class 'H' which does not have a default constructor}} | ||
// expected-note@-4 {{implicit destructor for 'H' first required here}} | ||
#else | ||
// expected-note@-6 {{default constructor of 'I' is implicitly deleted because base class 'H' has a deleted default constructor}} | ||
#endif | ||
#endif | ||
|
||
~I(); | ||
#if __cplusplus >= 201103L | ||
// expected-error@-2 {{non-deleted function '~I' cannot override a deleted function}} | ||
#endif | ||
}; | ||
|
||
struct J : public I { | ||
#ifdef MSABI | ||
// expected-note@+3 {{implicit default constructor for 'H' first required here}} | ||
// expected-note@+2 {{implicit default constructor for 'I' first required here}} | ||
#if __cplusplus <= 199711L | ||
// expected-note@-3 {{implicit default constructor for 'H' first required here}} | ||
// expected-note@-4 {{implicit default constructor for 'I' first required here}} | ||
#else | ||
// expected-note@-6 {{default constructor of 'J' is implicitly deleted because base class 'I' has a deleted default constructor}} | ||
#endif | ||
struct J : public I { | ||
#endif | ||
|
||
virtual void foo(); | ||
~J(); | ||
}; | ||
|
||
#ifdef MSABI | ||
J j; // expected-note {{implicit default constructor for 'J' first required here}} | ||
J j; | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{implicit default constructor for 'J' first required here}} | ||
#else | ||
void J::foo() { // expected-note {{implicit destructor for 'H' first required here}} | ||
// expected-error@-4 {{call to implicitly-deleted default constructor of 'J'}} | ||
#endif | ||
|
||
#else | ||
void J::foo() { | ||
#if __cplusplus <= 199711L | ||
// expected-note@-2 {{implicit destructor for 'H' first required here}} | ||
#endif | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters