[llvm] 05c1970 - [tblgen] Fix implicit conversion only diagnosed by g++ 6

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 15:26:43 PST 2020


Author: Benjamin Kramer
Date: 2020-01-29T00:25:44+01:00
New Revision: 05c19705d8edc05cc85cfef3b4e2cd172fc873a8

URL: https://github.com/llvm/llvm-project/commit/05c19705d8edc05cc85cfef3b4e2cd172fc873a8
DIFF: https://github.com/llvm/llvm-project/commit/05c19705d8edc05cc85cfef3b4e2cd172fc873a8.diff

LOG: [tblgen] Fix implicit conversion only diagnosed by g++ 6

Added: 
    

Modified: 
    llvm/include/llvm/TableGen/Record.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/TableGen/Record.h b/llvm/include/llvm/TableGen/Record.h
index 041156e71493..6667afe445bf 100644
--- a/llvm/include/llvm/TableGen/Record.h
+++ b/llvm/include/llvm/TableGen/Record.h
@@ -1726,21 +1726,21 @@ class RecordKeeper {
   }
 
   void addClass(std::unique_ptr<Record> R) {
-    bool Ins = Classes.insert(std::make_pair(R->getName(),
+    bool Ins = Classes.insert(std::make_pair(std::string(R->getName()),
                                              std::move(R))).second;
     (void)Ins;
     assert(Ins && "Class already exists");
   }
 
   void addDef(std::unique_ptr<Record> R) {
-    bool Ins = Defs.insert(std::make_pair(R->getName(),
+    bool Ins = Defs.insert(std::make_pair(std::string(R->getName()),
                                           std::move(R))).second;
     (void)Ins;
     assert(Ins && "Record already exists");
   }
 
   void addExtraGlobal(StringRef Name, Init *I) {
-    bool Ins = ExtraGlobals.insert(std::make_pair(Name, I)).second;
+    bool Ins = ExtraGlobals.insert(std::make_pair(std::string(Name), I)).second;
     (void)Ins;
     assert(!getDef(Name));
     assert(Ins && "Global already exists");


        


More information about the llvm-commits mailing list