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

Rahul Joshi via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 9 09:00:40 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"))];
----------------
jurahul wrote:

Agreed, changing to StringMap would be a different change. Also, we need to check if that ok to do in case we iterate over the map in a way that requires deterministic iteration order (and if StringMap does not guarantee that).

Can you fix the clang-format issue before approving?

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


More information about the cfe-commits mailing list