Fix #2201: Improve const and copy constructor for TVarLivePair.
authorJohn Kessenich <cepheus@frii.com>
Thu, 30 Apr 2020 07:56:38 +0000 (01:56 -0600)
committerJohn Kessenich <cepheus@frii.com>
Thu, 30 Apr 2020 07:59:50 +0000 (01:59 -0600)
glslang/MachineIndependent/iomapper.h

index 13a8932..e91a150 100644 (file)
@@ -238,12 +238,13 @@ typedef std::map<TString, TVarEntryInfo> TVarLiveMap;
 // In the future, if the vc++ compiler can handle such a situation,
 // this part of the code will be removed.
 struct TVarLivePair : std::pair<const TString, TVarEntryInfo> {
-    TVarLivePair(std::pair<const TString, TVarEntryInfo>& _Right) : pair(_Right.first, _Right.second) {}
+    TVarLivePair(const std::pair<const TString, TVarEntryInfo>& _Right) : pair(_Right.first, _Right.second) {}
     TVarLivePair& operator=(const TVarLivePair& _Right) {
         const_cast<TString&>(first) = _Right.first;
         second = _Right.second;
         return (*this);
     }
+    TVarLivePair(const TVarLivePair& src) { *this = src; }
 };
 typedef std::vector<TVarLivePair> TVarLiveVector;