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
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user