bool VisitBinaryOperator(BinaryOperator const * expr) { if (expr->getOpcode() != BO_Shr) { returntrue;
} if (ignoreLocation(expr)) { returntrue;
} auto t = expr->getLHS()->IgnoreParenImpCasts()->getType(); if (!loplugin::TypeCheck(t).Char()) { returntrue;
} if (!expr->getRHS()->getType()->isBuiltinType()) { //TODO: in which case the expression should be an // CXXOperatorCallExpr instead of a BinaryOperator? but at least // recent Clang trunk reports // // '(' >> orExpression // // (connectivity/source/commontools/RowFunctionParser.cxx, the RHS // being of type boost::spirit::rule<ScannerT>) here returntrue;
}
report(
DiagnosticsEngine::Warning,
("right shift of %0 is implementation-defined when 'char' is signed" " and value is negative"),
expr->getLHS()->getExprLoc())
<< t << expr->getSourceRange(); returntrue;
}
};
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.