Rename cdecl -> classdecl (MSVC treats the former like a keyword)
Change-Id: I1859a92c996b907b8d511cddba25c00c9a52f398
This commit is contained in:
@@ -651,8 +651,8 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
|
|||||||
if (ignoreLocation(expr)) {
|
if (ignoreLocation(expr)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
auto cdecl = expr->getConstructor()->getParent();
|
auto classdecl = expr->getConstructor()->getParent();
|
||||||
if (loplugin::DeclCheck(cdecl)
|
if (loplugin::DeclCheck(classdecl)
|
||||||
.Class("OUString").Namespace("rtl").GlobalNamespace())
|
.Class("OUString").Namespace("rtl").GlobalNamespace())
|
||||||
{
|
{
|
||||||
ChangeKind kind;
|
ChangeKind kind;
|
||||||
@@ -693,7 +693,7 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
|
|||||||
("construction of %0 with string constant argument"
|
("construction of %0 with string constant argument"
|
||||||
" containging non-ASCII characters"),
|
" containging non-ASCII characters"),
|
||||||
expr->getExprLoc())
|
expr->getExprLoc())
|
||||||
<< cdecl << expr->getSourceRange();
|
<< classdecl << expr->getSourceRange();
|
||||||
}
|
}
|
||||||
if (emb) {
|
if (emb) {
|
||||||
report(
|
report(
|
||||||
@@ -701,7 +701,7 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
|
|||||||
("construction of %0 with string constant argument"
|
("construction of %0 with string constant argument"
|
||||||
" containging embedded NULs"),
|
" containging embedded NULs"),
|
||||||
expr->getExprLoc())
|
expr->getExprLoc())
|
||||||
<< cdecl << expr->getSourceRange();
|
<< classdecl << expr->getSourceRange();
|
||||||
}
|
}
|
||||||
kind = ChangeKind::Char;
|
kind = ChangeKind::Char;
|
||||||
pass = n == 0
|
pass = n == 0
|
||||||
@@ -761,7 +761,7 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
|
|||||||
" as call of rtl::OUString::isEmpty"),
|
" as call of rtl::OUString::isEmpty"),
|
||||||
getMemberLocation(call))
|
getMemberLocation(call))
|
||||||
<< fdecl->getQualifiedNameAsString()
|
<< fdecl->getQualifiedNameAsString()
|
||||||
<< cdecl << call->getSourceRange();
|
<< classdecl << call->getSourceRange();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (dc.Operator(OO_ExclaimEqual).Namespace("rtl")
|
if (dc.Operator(OO_ExclaimEqual).Namespace("rtl")
|
||||||
@@ -774,7 +774,7 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
|
|||||||
" as call of !rtl::OUString::isEmpty"),
|
" as call of !rtl::OUString::isEmpty"),
|
||||||
getMemberLocation(call))
|
getMemberLocation(call))
|
||||||
<< fdecl->getQualifiedNameAsString()
|
<< fdecl->getQualifiedNameAsString()
|
||||||
<< cdecl << call->getSourceRange();
|
<< classdecl << call->getSourceRange();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((dc.Operator(OO_Plus).Namespace("rtl")
|
if ((dc.Operator(OO_Plus).Namespace("rtl")
|
||||||
@@ -788,7 +788,7 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
|
|||||||
" %1 with empty string constant argument"),
|
" %1 with empty string constant argument"),
|
||||||
getMemberLocation(call))
|
getMemberLocation(call))
|
||||||
<< fdecl->getQualifiedNameAsString()
|
<< fdecl->getQualifiedNameAsString()
|
||||||
<< cdecl << call->getSourceRange();
|
<< classdecl << call->getSourceRange();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (dc.Operator(OO_Equal).Class("OUString")
|
if (dc.Operator(OO_Equal).Class("OUString")
|
||||||
@@ -801,7 +801,7 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
|
|||||||
" as call of rtl::OUString::clear"),
|
" as call of rtl::OUString::clear"),
|
||||||
getMemberLocation(call))
|
getMemberLocation(call))
|
||||||
<< fdecl->getQualifiedNameAsString()
|
<< fdecl->getQualifiedNameAsString()
|
||||||
<< cdecl << call->getSourceRange();
|
<< classdecl << call->getSourceRange();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -817,7 +817,7 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
|
|||||||
+ " as operator =="),
|
+ " as operator =="),
|
||||||
getMemberLocation(call))
|
getMemberLocation(call))
|
||||||
<< fdecl->getQualifiedNameAsString()
|
<< fdecl->getQualifiedNameAsString()
|
||||||
<< cdecl << call->getSourceRange();
|
<< classdecl << call->getSourceRange();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((dc.Operator(OO_Plus).Namespace("rtl")
|
if ((dc.Operator(OO_Plus).Namespace("rtl")
|
||||||
@@ -871,7 +871,7 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
|
|||||||
+ (" in call of %1 as construction of"
|
+ (" in call of %1 as construction of"
|
||||||
" OUStringLiteral1")),
|
" OUStringLiteral1")),
|
||||||
getMemberLocation(expr))
|
getMemberLocation(expr))
|
||||||
<< cdecl
|
<< classdecl
|
||||||
<< fdecl->getQualifiedNameAsString()
|
<< fdecl->getQualifiedNameAsString()
|
||||||
<< expr->getSourceRange();
|
<< expr->getSourceRange();
|
||||||
} else {
|
} else {
|
||||||
@@ -881,7 +881,7 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
|
|||||||
+ describeChangeKind(kind)
|
+ describeChangeKind(kind)
|
||||||
+ " in call of %1"),
|
+ " in call of %1"),
|
||||||
getMemberLocation(expr))
|
getMemberLocation(expr))
|
||||||
<< cdecl
|
<< classdecl
|
||||||
<< fdecl->getQualifiedNameAsString()
|
<< fdecl->getQualifiedNameAsString()
|
||||||
<< expr->getSourceRange();
|
<< expr->getSourceRange();
|
||||||
}
|
}
|
||||||
@@ -1184,9 +1184,9 @@ void StringConstant::reportChange(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (isa<CXXConstructExpr>(call)) {
|
} else if (isa<CXXConstructExpr>(call)) {
|
||||||
auto cdecl = cast<CXXConstructExpr>(call)->getConstructor()
|
auto classdecl = cast<CXXConstructExpr>(call)
|
||||||
->getParent();
|
->getConstructor()->getParent();
|
||||||
loplugin::DeclCheck dc(cdecl);
|
loplugin::DeclCheck dc(classdecl);
|
||||||
if (dc.Class("OUString").Namespace("rtl").GlobalNamespace()
|
if (dc.Class("OUString").Namespace("rtl").GlobalNamespace()
|
||||||
|| (dc.Class("OUStringBuffer").Namespace("rtl")
|
|| (dc.Class("OUStringBuffer").Namespace("rtl")
|
||||||
.GlobalNamespace()))
|
.GlobalNamespace()))
|
||||||
@@ -1200,7 +1200,7 @@ void StringConstant::reportChange(
|
|||||||
+ (" with empty string constant argument as"
|
+ (" with empty string constant argument as"
|
||||||
" default construction of %0")),
|
" default construction of %0")),
|
||||||
getMemberLocation(call))
|
getMemberLocation(call))
|
||||||
<< cdecl->getQualifiedNameAsString()
|
<< classdecl->getQualifiedNameAsString()
|
||||||
<< call->getSourceRange();
|
<< call->getSourceRange();
|
||||||
} else {
|
} else {
|
||||||
assert(pass == PassThrough::NonEmptyConstantString);
|
assert(pass == PassThrough::NonEmptyConstantString);
|
||||||
@@ -1210,7 +1210,7 @@ void StringConstant::reportChange(
|
|||||||
+ describeChangeKind(kind)
|
+ describeChangeKind(kind)
|
||||||
+ " in construction of %0"),
|
+ " in construction of %0"),
|
||||||
getMemberLocation(expr))
|
getMemberLocation(expr))
|
||||||
<< cdecl->getQualifiedNameAsString()
|
<< classdecl->getQualifiedNameAsString()
|
||||||
<< expr->getSourceRange();
|
<< expr->getSourceRange();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user