Skip to content

Commit f313b0a

Browse files
authored
[Clang][NFC] Capture by ref to avoid copying std::string (llvm#138231)
Static analysis flagged capturing BName by value as opposed to by reference. Updated capture to be by reference.
1 parent 17fdcda commit f313b0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/StaticAnalyzer/Core/CheckerContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ bool CheckerContext::isCLibraryFunction(const FunctionDecl *FD,
6767
// _xxxxx_
6868
// ^ ^ lookbehind and lookahead characters
6969

70-
const auto MatchPredecessor = [=]() -> bool {
70+
const auto MatchPredecessor = [&]() -> bool {
7171
return start <= 0 || !llvm::isAlpha(BName[start - 1]);
7272
};
73-
const auto MatchSuccessor = [=]() -> bool {
73+
const auto MatchSuccessor = [&]() -> bool {
7474
std::size_t LookbehindPlace = start + Name.size();
7575
return LookbehindPlace >= BName.size() ||
7676
!llvm::isAlpha(BName[LookbehindPlace]);

0 commit comments

Comments
 (0)