Skip to content

Commit 8f434bb

Browse files
authored
[clang] Fix a dangling reference in clang/utils/TableGen/ClangDiagnosticsEmitter.cpp (#119197)
`DiagsInGroup` is a `map<llvm::StringRef, ...>`, we store a dangling string_view in the key.
1 parent 30ad53b commit 8f434bb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/utils/TableGen/ClangDiagnosticsEmitter.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1907,8 +1907,7 @@ void clang::EmitClangDiagDocs(const RecordKeeper &Records, raw_ostream &OS) {
19071907
// Write out the diagnostic groups.
19081908
for (const Record *G : DiagGroups) {
19091909
bool IsRemarkGroup = isRemarkGroup(G, DiagsInGroup);
1910-
auto &GroupInfo =
1911-
DiagsInGroup[std::string(G->getValueAsString("GroupName"))];
1910+
auto &GroupInfo = DiagsInGroup[G->getValueAsString("GroupName")];
19121911
bool IsSynonym = GroupInfo.DiagsInGroup.empty() &&
19131912
GroupInfo.SubGroups.size() == 1;
19141913

0 commit comments

Comments
 (0)