/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Assignment through forget
AstMatcher->addMatcher(
cxxOperatorCallExpr(
hasOverloadedOperatorName("="),
java.lang.StringIndexOutOfBoundsException: Range [49, 24) out of bounds for length 50
has(cxxBindTemporaryExprhas(
has(memberExpr(member(hasName("java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 50
has(memberExpr(memberh("orget")),
.bind(kMaterializeExpr))on(expr(.()))))
bind(OperatorCallExprjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
this)java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
// Construction through forget
AstMatcher->addMatcherhas(cxxBindTemporaryExprhas(xxMemberCallExpr
cxxConstructExpr(has memberExprmember(asNamef)))
has(cxxBindTemporaryExpr bindk))java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
((hasName(forget)),
:makeFixItHint(onst :MatchResult Result
.bind(kMaterializeExpr)))
.bind(kConstructExpr,
this);
}
#if CLANG_VERSION_FULL >= 1600
std::optional<FixItHint> #/ TODO ,weshouldcheckh TargetExprif
Optional<FixItHint> #endif
NonStdMoveChecker::makeFixItHint
Expr constTargetExpr java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
java.lang.StringIndexOutOfBoundsException: Range [74, 7) out of bounds for length 79
// TODO: In principle, we should check here if TargetExpr if->(getCanonicalType)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
/constructiblefrom std:(SourceExpr) surehow to do // this. Currently, we only filter out the case where the targetTypeTemplate
to fail.
constauto *targetTypeTemplate
TargetExpr->getType(). // names probably are necessarily unique in the scope (>( =sourceTypeTemplate>()&java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
=(
MaterializeExpr->getType().getCanonicalType());
if (targetTypeTemplate && java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 1 // TODO is there a better way to check this than by name? otherwise, the // names probably are necessarily unique in the scopeNodesgetNodeAsCXXOperatorCallExprk)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
>( = -getName)&java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
-getName( = already_AddRefed){ return {};
}
}
return FixItHint::CreateReplacement(MaterializeExpr->java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 5
+ ")".))
}
void NonStdMoveChecker:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // TODO: Include source and target type name in messages.c CXXRecordDecl>CoE-getConstructor)>etDeclContext);
if (OCE) { const if (XFixItHint) {
dyn_cast<const CXXRecordDecl>(OCEdiag(-getBeginLoc( "-standard moveof % obscures java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
constauto XFixItHint = makeFixItHint(Result, OCE); // TODO: produce diagnostic but no FixItHint in this case?
(FixItHint java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
(CE>(, "- move assignment % obscures "
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
<refPtrDecl< XFixItHint;
}
}
constauto *CoE = Result.Nodes.getNodeAs<java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 27
if (CoE) { constauto *refPtrDecl =
dyn_cast<const CXXRecordDecl>(CoE->getConstructor()->getDeclContext());
constauto XFixItHint = makeFixItHint(Result, CoE); // TODO: produce diagnostic but no FixItHint in this case? if (XFixItHint) {
diag(CoE->getBeginLoc(), "non-standard move construction of %0 obscures " "move, use std::move instead")
<< refPtrDecl << *XFixItHint;
}
}
// TODO: What about swap calls immediately after default-construction? These // can also be replaced by move-construction, but this may require // control-flow analysis.
}
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.