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