diff options
author | Nico Weber <nicolasweber@gmx.de> | 2017-08-31 06:17:08 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2017-08-31 06:17:08 +0000 |
commit | bf2260ca6276a5f7a18e3bc7d7a55d46fed163bf (patch) | |
tree | 5901dd38ab869bae0b2f92117b41b8d7f559c8c6 /clang/test/SemaCXX/destructor.cpp | |
parent | a22742be5a2703c0773f9613c3e385ae3861ce15 (diff) | |
download | bcm5719-llvm-bf2260ca6276a5f7a18e3bc7d7a55d46fed163bf.tar.gz bcm5719-llvm-bf2260ca6276a5f7a18e3bc7d7a55d46fed163bf.zip |
Suppress -Wdelete-non-virtual-dtor warnings about classes defined in system headers.
r312167 made it so that we emit Wdelete-non-virtual-dtor from delete statements
that are in system headers (e.g. std::unique_ptr). That works great on Linux
and macOS, but on Windows there are non-final classes that are defined in
system headers that have virtual methods but non-virtual destructors and yet
get deleted through a base class pointer (e.g. ATL::CAccessToken::CRevert). So
paddle back a bit and don't emit the warning if it's about a class defined in a
system header.
https://reviews.llvm.org/D37324
llvm-svn: 312216
Diffstat (limited to 'clang/test/SemaCXX/destructor.cpp')
-rw-r--r-- | clang/test/SemaCXX/destructor.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/destructor.cpp b/clang/test/SemaCXX/destructor.cpp index 31ee60a718a..69d44f5c8ae 100644 --- a/clang/test/SemaCXX/destructor.cpp +++ b/clang/test/SemaCXX/destructor.cpp @@ -8,6 +8,11 @@ #pragma clang system_header namespace dnvd { + +struct SystemB { + virtual void foo(); +}; + template <typename T> class simple_ptr { public: @@ -249,6 +254,7 @@ private: }; void use(B&); +void use(SystemB&); void use(VB&); void nowarnstack() { @@ -399,6 +405,11 @@ void nowarn1() { simple_ptr<VF> vf(new VF()); use(*vf); } + { + simple_ptr<SystemB> sb(new SystemB()); + use(*sb); + } + } void warn1() { |