summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2017-08-30 20:25:22 +0000
committerNico Weber <nicolasweber@gmx.de>2017-08-30 20:25:22 +0000
commit955bb84090c13ad03017cea9ded2d19a819e90c9 (patch)
treed0315fa7875b8334a5033722a21c47492377c629 /clang/lib/Sema/SemaExprCXX.cpp
parent6be49244b1e19fd8675b1fe7581cb4a37ba80bcb (diff)
downloadbcm5719-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.cpp2
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:
OpenPOWER on IntegriCloud