diff --git a/llvm/lib/TextAPI/RecordsSlice.cpp b/llvm/lib/TextAPI/RecordsSlice.cpp index 1500b8752115a..1d04b63606522 100644 --- a/llvm/lib/TextAPI/RecordsSlice.cpp +++ b/llvm/lib/TextAPI/RecordsSlice.cpp @@ -259,7 +259,7 @@ ObjCInterfaceRecord::getObjCCategories() const { ObjCIVarRecord *ObjCContainerRecord::addObjCIVar(StringRef IVar, RecordLinkage Linkage) { - auto Result = IVars.insert({IVar, nullptr}); + auto Result = IVars.try_emplace(IVar); if (Result.second) Result.first->second = std::make_unique(IVar, Linkage); return Result.first->second.get();