summaryrefslogtreecommitdiffstats
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-05-31 12:05:43 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-05-31 12:05:43 +0200
commit22a69119293ab94f28ca3120362b95eb38ba78d9 (patch)
tree48618a625a7095f0b5bbae95e0605374560aa7e7 /compilerplugins
parenttdf#104219 Don't export color information when color is automatic (diff)
downloadcore-22a69119293ab94f28ca3120362b95eb38ba78d9.tar.gz
core-22a69119293ab94f28ca3120362b95eb38ba78d9.zip
The updated values of t1, t2 are unused
...since f1bbda1c26dc16642038ea70288eec60b43520b6 "loplugin:cstylecast: deal with remaining pointer casts" Change-Id: Idecc702344c674e6f39051e4f8c2114017e317cb
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/cstylecast.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx
index addf5edd28ba..62d25acdaf20 100644
--- a/compilerplugins/clang/cstylecast.cxx
+++ b/compilerplugins/clang/cstylecast.cxx
@@ -144,13 +144,9 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * expr) {
if( expr->getCastKind() == CK_NoOp ) {
QualType t1 = expr->getSubExpr()->getType();
QualType t2 = expr->getType();
- if (t1->isPointerType() && t2->isPointerType()) {
- t1 = t1->getAs<PointerType>()->getPointeeType();
- t2 = t2->getAs<PointerType>()->getPointeeType();
- } else if (t1->isLValueReferenceType() && t2->isLValueReferenceType()) {
- t1 = t1->getAs<LValueReferenceType>()->getPointeeType();
- t2 = t2->getAs<LValueReferenceType>()->getPointeeType();
- } else {
+ if (!((t1->isPointerType() && t2->isPointerType())
+ || (t1->isLValueReferenceType() && t2->isLValueReferenceType())))
+ {
return true;
}
if (isConstCast(