Skip to content

Commit 5e9e1ff

Browse files
authored
[clang] Infer capture_by for insert_or_assign (#122109)
Useful for maps: https://en.cppreference.com/w/cpp/container/map/insert_or_assign
1 parent 3b92cf2 commit 5e9e1ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Sema/SemaAttr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ void Sema::inferLifetimeCaptureByAttribute(FunctionDecl *FD) {
307307
Annotate(MD);
308308
return;
309309
}
310-
static const llvm::StringSet<> CapturingMethods{"insert", "push",
311-
"push_front", "push_back"};
310+
static const llvm::StringSet<> CapturingMethods{
311+
"insert", "insert_or_assign", "push", "push_front", "push_back"};
312312
if (!CapturingMethods.contains(MD->getName()))
313313
return;
314314
Annotate(MD);

0 commit comments

Comments
 (0)