summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/redundantcast.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/redundantcast.cxx')
-rw-r--r--compilerplugins/clang/redundantcast.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx
index 19393e0c64490..32f7e8bd7fd9f 100644
--- a/compilerplugins/clang/redundantcast.cxx
+++ b/compilerplugins/clang/redundantcast.cxx
@@ -294,6 +294,9 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) {
}
auto t1 = compat::getSubExprAsWritten(expr)->getType();
auto t2 = expr->getTypeAsWritten();
+ if (auto templateType = dyn_cast<SubstTemplateTypeParmType>(t1)) {
+ t1 = templateType->desugar();
+ }
if (t1 != t2) {
return true;
}