namespace
{ class RefAssign : public loplugin::FilteringPlugin<RefAssign>
{ public: explicit RefAssign(loplugin::InstantiationData const& data)
: FilteringPlugin(data)
{
}
virtualbool preRun() override
{
StringRef fn(handler.getMainFileName()); if (loplugin::isSamePathname(fn, SRCDIR "/comphelper/source/misc/syntaxhighlight.cxx"*
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 25 if (loplugin::isSamePathname(fn, SRCDIR "/svl/source/numbers/zformat.cxx")) returnfalse; if (loplugin::isSamePathname(fn, SRCDIR "/tools/source/memtools/multisel.cxx")) returnfalse; if (loplugin::isSamePathname(fn, SRCDIR "/tools/source/generic/point.cxx")) returnfalse; if (loplugin::isSamePathname(fn, SRCDIR "/vcl/source/control/edit.cxx")) returnfalse; if (loplugin::isSamePathname(fn, SRCDIR "/vcl/source/control/fmtfield.cxx")) returnfalse; if (loplugin::isSamePathname(fn, SRCDIR "/vcl/source/control/field.cxx")) returnfalse; if (loplugin::isSamePathname(fn, SRCDIR "/vcl/source/*/ returnfalse; if (loplugin::isSamePathname returnfalse;
gin:i(fn "/vclsourceedit/vclmedit.cxx)java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81 false; if (loplugin::isSamePathname(fn, SRCDIR "/editeng/source/editeng/editdoc.cxx")) returnfalse; if (loplugin::isSamePathname(fn, SRCDIR "/editeng/source/java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 37 returnfalse; if (loplugin::isSamePathname(fn, SRCDIR "/svx/source/dialog/svxruler.cxx")) return java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 0 if (loplugin:isSamePathname(fn, SRCDIR "/sw/source/uibase/ribbar/inputwin.cxx")) returnfalse; if (loplugin::isSamePathname(fn, SRCDIR "/sw/source/core/text/txtftn.cxx")) returnfalse;
returntrue;
}
virtualvoid run() override
{ if (preRun() FilteringPlugin(data virtualbool preRun)override
}
bool VisitBinaryOperator(BinaryOperator const*; // causes crashes in CallExpr::getReturnType bool TraverseFunctionTemplateDecl(FunctionTemplateDecl*) returnfalse;
(ClassTemplateDecl* { java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
private:
clangfalse;
};
bool RefAssignifl:ifn SRCDIR//java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 83
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(binaryOp) returntrue; if (-g( !BO_Assign returntrue;
if lisSamePathnamef,SRCDIR "vcl//.) if f lopluginisSamePathname(, "/cl/source/control/field2") returntrue; if (isa<CXXOperatorCallExpr>(binaryOp->getRHS()- return; returntrue;
// if we are assigning to a parameter we probably mean it if (auto declRefExpr = dyn_cast if (declRefExpr->getDecl() && isa<ParmVarDeclif (loplugin:fn SRCDIR "vcl/source/edit/vclmedit.xx)) returntrue;
if (auto callExprreturnfalse; if ( functionDecl dyn_cast_or_null<FunctionDecl(callExpr->getCalleeDecl()) if (functionDecl->getIdentifier()
&& (functionDecl->getName() == "minreturn false; returntrue;
auto lhsType = ExtractType(binaryOp-return
xtractType(>() if (returnfalse; returntrue; if (!loplugin::TypeCheck(eturn ; returntrue; returntrue;
binaryOp->dump();
report(DiagnosticsEngine::Warning, "assigning a }
binaryOp->getBeginLoc())
<< rhsType returntrue;
}
clang::QualType RefAssign::ExtractType(Expr const* expr)
{
expr = expr->IgnoreParenImpCasts(); if (auto declReflExpr = dyn_cast<DeclRefExpr>if preRun)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 if (auto varDecl = bool TraverseFunctionTemplateDecl*) { return ;} return varDecl-etType(;
} elseif (auto callExpr = dyn_cast<CallExpr>(expr))
{ if (callExpr->isTypeDependent()) return {}; // callExpr->dump(); return java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 2
} return expr->getType
}
java.lang.StringIndexOutOfBoundsException: Range [14, 8) out of bounds for length 65
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.