diff options
author | Nico Weber <nicolasweber@gmx.de> | 2017-08-30 20:25:22 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2017-08-30 20:25:22 +0000 |
commit | 955bb84090c13ad03017cea9ded2d19a819e90c9 (patch) | |
tree | d0315fa7875b8334a5033722a21c47492377c629 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | 6be49244b1e19fd8675b1fe7581cb4a37ba80bcb (diff) | |
download | bcm5719-llvm-955bb84090c13ad03017cea9ded2d19a819e90c9.tar.gz bcm5719-llvm-955bb84090c13ad03017cea9ded2d19a819e90c9.zip |
Let -Wdelete-non-virtual-dtor fire in system headers too.
Makes the warning useful again in a std::unique_ptr world, PR28460.
Also make the warning not fire in unevaluated contexts, since system libraries
(e.g. libc++) do do that. This would've been a good change before we started
emitting this warning in system headers too, but "normal" code seems to be less
template-heavy, so we didn't notice until now.
https://reviews.llvm.org/D37235
llvm-svn: 312167
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 456aff2fe00..8de3d33d085 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -3284,7 +3284,7 @@ void Sema::CheckVirtualDtorCall(CXXDestructorDecl *dtor, SourceLocation Loc, bool IsDelete, bool CallCanBeVirtual, bool WarnOnNonAbstractTypes, SourceLocation DtorLoc) { - if (!dtor || dtor->isVirtual() || !CallCanBeVirtual) + if (!dtor || dtor->isVirtual() || !CallCanBeVirtual || isUnevaluatedContext()) return; // C++ [expr.delete]p3: |