loplugin:redundantcast: Don't warn about certain casts in macros

...that might depend on macro arguments and not really be redundant

Change-Id: If19de3835a4972add58965ea7c0936fad7ef6957
This commit is contained in:
Stephan Bergmann
2015-03-28 18:56:43 +01:00
parent 7937984a6a
commit 13e45d6fde

View File

@@ -25,6 +25,7 @@
#include "clang/Sema/Sema.h"
#include "compat.hxx"
#include "plugin.hxx"
namespace {
@@ -143,7 +144,9 @@ if(!cc->getSubExpr()->getType()->isPointerType()){
} else if (isa<CXXStaticCastExpr>(e)
&& isVoidPointer(
dyn_cast<CXXStaticCastExpr>(e)->getSubExpr()
->IgnoreParenImpCasts()->getType()))
->IgnoreParenImpCasts()->getType())
&& !compat::isMacroBodyExpansion(
compiler, e->getLocStart()))
{
report(
DiagnosticsEngine::Warning,