const auto *BinaryOp = Result.Nodes.getNodeAs<BinaryOperator>("SizeBinaryOp");
const auto *E = Result.Nodes.getNodeAs<Expr>("STLObject");
FixItHint Hint;
- std::string ReplacementText =
- Lexer::getSourceText(CharSourceRange::getTokenRange(E->getSourceRange()),
- *Result.SourceManager, LangOptions());
+ std::string ReplacementText = Lexer::getSourceText(
+ CharSourceRange::getTokenRange(E->getSourceRange()),
+ *Result.SourceManager, Result.Context->getLangOpts());
if (E->getType()->isPointerType())
ReplacementText += "->empty()";
else
StringRef SmartptrText = Lexer::getSourceText(
CharSourceRange::getTokenRange(Smartptr->getSourceRange()),
- *Result.SourceManager, LangOptions());
+ *Result.SourceManager, Result.Context->getLangOpts());
// Replace foo->get() with *foo, and foo.get() with foo.
std::string Replacement = Twine(IsPtrToPtr ? "*" : "", SmartptrText).str();
diag(GetCall->getLocStart(), "Redundant get() call on smart pointer.")