diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx index 1f580e588293..22e2ddf0094a 100644 --- a/compilerplugins/clang/redundantcast.cxx +++ b/compilerplugins/clang/redundantcast.cxx @@ -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(e) && isVoidPointer( dyn_cast(e)->getSubExpr() - ->IgnoreParenImpCasts()->getType())) + ->IgnoreParenImpCasts()->getType()) + && !compat::isMacroBodyExpansion( + compiler, e->getLocStart())) { report( DiagnosticsEngine::Warning,