[clang] [clang] Fix a dangling reference in clang/utils/TableGen/ClangDiagnosticsEmitter.cpp (PR #119197)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 9 07:55:14 PST 2024


================
@@ -1908,7 +1908,7 @@ void clang::EmitClangDiagDocs(const RecordKeeper &Records, raw_ostream &OS) {
   for (const Record *G : DiagGroups) {
     bool IsRemarkGroup = isRemarkGroup(G, DiagsInGroup);
     auto &GroupInfo =
-        DiagsInGroup[std::string(G->getValueAsString("GroupName"))];
----------------
hokein wrote:

Interesting, there is a recent commit which changes the `map<std::string, ...>` to `map<llvm::StringRef, ...>`, https://github.com/llvm/llvm-project/commit/17c6ec6db1430e7e00c0e2a2ad6d26fa94fe8cf1 , which leads to this dangling reference, cc @jurahul

If we want to change to StringMap, I think it is a separate change.




https://github.com/llvm/llvm-project/pull/119197


More information about the cfe-commits mailing list