loplugin:stringconstant: OUStringLiteral1 can handle NUL literals just fine

Change-Id: I9b31b01a34a10d5bd329dccd39da83500d6fd2c7
This commit is contained in:
Stephan Bergmann 2015-06-26 13:51:13 +02:00
parent edc96a157e
commit 8fd802eb33

View File

@ -1191,11 +1191,11 @@ void StringConstant::handleOUStringCtor(
&& e3->getArg(0)->IgnoreParenImpCasts()->isIntegerConstantExpr(
res, compiler.getASTContext()))
{
if (res.getZExtValue() > 0 && res.getZExtValue() <= 127) {
if (res.getZExtValue() <= 127) {
report(
DiagnosticsEngine::Warning,
("in call of %0, replace OUString constructed from a (non-NUL)"
" ASCII char constant with a string literal"),
("in call of %0, replace OUString constructed from an ASCII"
" char constant with a string literal"),
e3->getExprLoc())
<< qname << expr->getSourceRange();
}