loplugin:stringconstant: OUStringLiteral1 can handle NUL literals just fine
Change-Id: I9b31b01a34a10d5bd329dccd39da83500d6fd2c7
This commit is contained in:
@@ -1191,11 +1191,11 @@ void StringConstant::handleOUStringCtor(
|
|||||||
&& e3->getArg(0)->IgnoreParenImpCasts()->isIntegerConstantExpr(
|
&& e3->getArg(0)->IgnoreParenImpCasts()->isIntegerConstantExpr(
|
||||||
res, compiler.getASTContext()))
|
res, compiler.getASTContext()))
|
||||||
{
|
{
|
||||||
if (res.getZExtValue() > 0 && res.getZExtValue() <= 127) {
|
if (res.getZExtValue() <= 127) {
|
||||||
report(
|
report(
|
||||||
DiagnosticsEngine::Warning,
|
DiagnosticsEngine::Warning,
|
||||||
("in call of %0, replace OUString constructed from a (non-NUL)"
|
("in call of %0, replace OUString constructed from an ASCII"
|
||||||
" ASCII char constant with a string literal"),
|
" char constant with a string literal"),
|
||||||
e3->getExprLoc())
|
e3->getExprLoc())
|
||||||
<< qname << expr->getSourceRange();
|
<< qname << expr->getSourceRange();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user