More loplugin::TypeCheck use
Change-Id: I2f4a26a918134568f541cd45bdcf5a12b1f1d2ee
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <fstream>
|
||||
#include <regex>
|
||||
#include "plugin.hxx"
|
||||
#include "typecheck.hxx"
|
||||
#include "clang/Frontend/CompilerInstance.h"
|
||||
|
||||
namespace {
|
||||
@@ -45,11 +46,6 @@ clang::Expr const * ignoreParenImplicitComma(clang::Expr const * expr) {
|
||||
}
|
||||
}
|
||||
|
||||
bool isPlainChar(clang::QualType type) {
|
||||
return type->isSpecificBuiltinType(clang::BuiltinType::Char_S)
|
||||
|| type->isSpecificBuiltinType(clang::BuiltinType::Char_U);
|
||||
}
|
||||
|
||||
bool overridesXServiceInfo(clang::CXXMethodDecl const * decl) {
|
||||
for (auto i = decl->begin_overridden_methods();
|
||||
i != decl->end_overridden_methods(); ++i)
|
||||
@@ -145,7 +141,8 @@ bool GetImplementationName::isStringConstant(
|
||||
{
|
||||
QualType t = expr->getType();
|
||||
if (!(t->isConstantArrayType() && t.isConstQualified()
|
||||
&& isPlainChar(t->getAsArrayTypeUnsafe()->getElementType())))
|
||||
&& (loplugin::TypeCheck(t->getAsArrayTypeUnsafe()->getElementType())
|
||||
.Char())))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user