summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/redundantcast.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-10-22 11:57:44 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-10-22 11:57:44 +0200
commit5807952ef7bc9252eca7fa11a16454af59576a12 (patch)
treefaba07b6dd2b3f9d3d4fec06cf6f65d6e0e13ccd /compilerplugins/clang/redundantcast.cxx
parent380d6afe5fd691f6ad4b17fc38b79b9fca4ba906 (diff)
loplugin:redundantcast: Do warn about convoluted dynamic_cast to self
...that the compiler is free to elide anyway. (See 4e7ffc0a69dac31ca7e0f1649f1697a1ff8d6e5f "Avoid compiler eliding#redundant dynamic_cast" and 380d6afe5fd691f6ad4b17fc38b79b9fca4ba906 "Remove redundant asserts involving dynamic_cast".) Change-Id: I3f75154fee3e978b7ba95a5a27589417065599bd
Diffstat (limited to 'compilerplugins/clang/redundantcast.cxx')
-rw-r--r--compilerplugins/clang/redundantcast.cxx5
1 files changed, 0 insertions, 5 deletions
diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx
index c28878e9e536..c86d7dc1ab73 100644
--- a/compilerplugins/clang/redundantcast.cxx
+++ b/compilerplugins/clang/redundantcast.cxx
@@ -682,11 +682,6 @@ bool RedundantCast::VisitCXXDynamicCastExpr(CXXDynamicCastExpr const * expr) {
if (ignoreLocation(expr)) {
return true;
}
- // ignore dynamic_cast<T1>(static_cast<T1>(void*)), it's necessary
- if (auto subStaticCast = dyn_cast<CXXStaticCastExpr>(expr->getSubExpr())) {
- if (loplugin::TypeCheck(subStaticCast->getSubExpr()->getType()).Pointer().Void())
- return true;
- }
// so far this only deals with dynamic casting from T to T
auto const sub = compat::getSubExprAsWritten(expr);
auto const t1 = expr->getTypeAsWritten();