diff --git a/compilerplugins/clang/implicitboolconversion.cxx b/compilerplugins/clang/implicitboolconversion.cxx index 41ece58d1f7a..dec8e233ebb8 100644 --- a/compilerplugins/clang/implicitboolconversion.cxx +++ b/compilerplugins/clang/implicitboolconversion.cxx @@ -828,7 +828,11 @@ bool ImplicitBoolConversion::isExternCFunctionCall( Decl const * d = expr->getCalleeDecl(); if (d != nullptr) { FunctionDecl const * fd = dyn_cast(d); - if (fd != nullptr && fd->isExternC()) { + if (fd != nullptr + && (fd->isExternC() + || compiler.getSourceManager().isInExternCSystemHeader( + fd->getLocation()))) + { PointerType const * pt = fd->getType()->getAs(); QualType t2(pt == nullptr ? fd->getType() : pt->getPointeeType()); *functionType = t2->getAs();