[PATCH] D56536: [clang-tidy] Fix case of local variables in modernize-use-nodiscard checker
Jonas Toth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 10 04:00:33 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL350814: [clang-tidy] Fix case of local variables in modernize-use-nodiscard checker (authored by JonasToth, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D56536?vs=181017&id=181023#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56536/new/
https://reviews.llvm.org/D56536
Files:
clang-tools-extra/trunk/clang-tidy/modernize/UseNodiscardCheck.cpp
Index: clang-tools-extra/trunk/clang-tidy/modernize/UseNodiscardCheck.cpp
===================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/UseNodiscardCheck.cpp
+++ clang-tools-extra/trunk/clang-tidy/modernize/UseNodiscardCheck.cpp
@@ -92,7 +92,7 @@
!getLangOpts().CPlusPlus)
return;
- auto functionObj =
+ auto FunctionObj =
cxxRecordDecl(hasAnyName("::std::function", "::boost::function"));
// Find all non-void const methods which have not already been marked to
@@ -107,8 +107,8 @@
hasAttr(clang::attr::WarnUnusedResult),
hasType(isInstantiationDependentType()),
hasAnyParameter(anyOf(
- parmVarDecl(anyOf(hasType(functionObj),
- hasType(references(functionObj)))),
+ parmVarDecl(anyOf(hasType(FunctionObj),
+ hasType(references(FunctionObj)))),
hasType(isNonConstReferenceOrPointer()),
hasParameterPack()))))))
.bind("no_discard"),
@@ -122,11 +122,11 @@
if (Loc.isInvalid() || Loc.isMacroID())
return;
- SourceLocation retLoc = MatchedDecl->getInnerLocStart();
+ SourceLocation RetLoc = MatchedDecl->getInnerLocStart();
ASTContext &Context = *Result.Context;
- auto Diag = diag(retLoc, "function %0 should be marked " + NoDiscardMacro)
+ auto Diag = diag(RetLoc, "function %0 should be marked " + NoDiscardMacro)
<< MatchedDecl;
// Check for the existence of the keyword being used as the ``[[nodiscard]]``.
@@ -137,7 +137,7 @@
// 1. A const member function which returns a variable which is ignored
// but performs some external I/O operation and the return value could be
// ignored.
- Diag << FixItHint::CreateInsertion(retLoc, NoDiscardMacro + " ");
+ Diag << FixItHint::CreateInsertion(RetLoc, NoDiscardMacro + " ");
}
} // namespace modernize
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56536.181023.patch
Type: text/x-patch
Size: 2042 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190110/eca02445/attachment.bin>
More information about the llvm-commits
mailing list