Kaydet (Commit) e12e0087 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Suppress loplugin:implicitboolconversion warnings in Objective-C code

...(but not Objective-C++ code) where BOOL (aka unsigned char) expressions are
routinely implicitly converted to int per the C rules, e.g., as operands of &&.

Change-Id: I17e5dae9f065aaa814850196b1ef31f8fb07c99b
üst fc9e78c7
...@@ -951,11 +951,13 @@ void ImplicitBoolConversion::checkCXXConstructExpr( ...@@ -951,11 +951,13 @@ void ImplicitBoolConversion::checkCXXConstructExpr(
} }
void ImplicitBoolConversion::reportWarning(ImplicitCastExpr const * expr) { void ImplicitBoolConversion::reportWarning(ImplicitCastExpr const * expr) {
report( if (!compiler.getLangOpts().ObjC2 || compiler.getLangOpts().CPlusPlus) {
DiagnosticsEngine::Warning, report(
"implicit conversion (%0) from %1 to %2", expr->getLocStart()) DiagnosticsEngine::Warning,
<< expr->getCastKindName() << expr->getSubExprAsWritten()->getType() "implicit conversion (%0) from %1 to %2", expr->getLocStart())
<< expr->getType() << expr->getSourceRange(); << expr->getCastKindName() << expr->getSubExprAsWritten()->getType()
<< expr->getType() << expr->getSourceRange();
}
} }
loplugin::Plugin::Registration<ImplicitBoolConversion> X( loplugin::Plugin::Registration<ImplicitBoolConversion> X(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment