diff options
-rw-r--r-- | compilerplugins/clang/implicitboolconversion.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compilerplugins/clang/implicitboolconversion.cxx b/compilerplugins/clang/implicitboolconversion.cxx index 0d933bfa4480..3f255ff35efe 100644 --- a/compilerplugins/clang/implicitboolconversion.cxx +++ b/compilerplugins/clang/implicitboolconversion.cxx @@ -951,11 +951,13 @@ void ImplicitBoolConversion::checkCXXConstructExpr( } void ImplicitBoolConversion::reportWarning(ImplicitCastExpr const * expr) { - report( - DiagnosticsEngine::Warning, - "implicit conversion (%0) from %1 to %2", expr->getLocStart()) - << expr->getCastKindName() << expr->getSubExprAsWritten()->getType() - << expr->getType() << expr->getSourceRange(); + if (!compiler.getLangOpts().ObjC2 || compiler.getLangOpts().CPlusPlus) { + report( + DiagnosticsEngine::Warning, + "implicit conversion (%0) from %1 to %2", expr->getLocStart()) + << expr->getCastKindName() << expr->getSubExprAsWritten()->getType() + << expr->getType() << expr->getSourceRange(); + } } loplugin::Plugin::Registration<ImplicitBoolConversion> X( |