Blob Blame History Raw
commit 63dc5b9b1b3e8fb875304a954e4df934b249034b
Author: Dimitri van Heesch <doxygen@gmail.com>
Date:   Wed Aug 26 21:23:29 2020 +0200

    issue #7977: Broken ref for enum entry (doxygen 1.8.18 -> 1.8.19)

diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 757e7831..d5512925 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -6946,7 +6946,14 @@ static void addEnumValuesToEnums(const Entry *root)
       MemberName *mn = mnsd->find(name); // for all members with this name
       if (mn)
       {
-        std::vector< std::unique_ptr<MemberDef> > extraMembers;
+        struct EnumValueInfo
+        {
+          EnumValueInfo(const QCString &n,std::unique_ptr<MemberDef> &md) :
+            name(n), member(std::move(md)) {}
+          QCString name;
+          std::unique_ptr<MemberDef> member;
+        };
+        std::vector< EnumValueInfo > extraMembers;
         // for each enum in this list
         for (const auto &md : *mn)
         {
@@ -7006,8 +7013,7 @@ static void addEnumValuesToEnums(const Entry *root)
                   fmd->setAnchor();
                   md->insertEnumField(fmd.get());
                   fmd->setEnumScope(md.get(),TRUE);
-                  mn=mnsd->add(e->name);
-                  extraMembers.push_back(std::move(fmd));
+                  extraMembers.push_back(EnumValueInfo(e->name,fmd));
                 }
               }
               else
@@ -7071,9 +7077,10 @@ static void addEnumValuesToEnums(const Entry *root)
           }
         }
         // move the newly added members into mn
-        for (auto &md : extraMembers)
+        for (auto &e : extraMembers)
         {
-          mn->push_back(std::move(md));
+          MemberName *emn=mnsd->add(e.name);
+          emn->push_back(std::move(e.member));
         }
       }
     }