From 97ee5c88deac4f48bd88525e678abc188663c9b2 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Thu, 30 Apr 2020 01:56:38 -0600 Subject: [PATCH] Fix #2201: Improve const and copy constructor for TVarLivePair. --- glslang/MachineIndependent/iomapper.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glslang/MachineIndependent/iomapper.h b/glslang/MachineIndependent/iomapper.h index 13a8932b9..e91a15094 100644 --- a/glslang/MachineIndependent/iomapper.h +++ b/glslang/MachineIndependent/iomapper.h @@ -238,12 +238,13 @@ typedef std::map 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 { - TVarLivePair(std::pair& _Right) : pair(_Right.first, _Right.second) {} + TVarLivePair(const std::pair& _Right) : pair(_Right.first, _Right.second) {} TVarLivePair& operator=(const TVarLivePair& _Right) { const_cast(first) = _Right.first; second = _Right.second; return (*this); } + TVarLivePair(const TVarLivePair& src) { *this = src; } }; typedef std::vector TVarLiveVector;