Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37651141
en ru br
ALT Linux repos
S:3.5.3-alt2_3jpp11

Group :: Development/Java
RPM: antlr3

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: 0006-antlr3memory.hpp-fix-for-C-20-mode.patch
Download


From 478902a7e57e2283c57410f5aa14939e743b5102 Mon Sep 17 00:00:00 2001
From: Avi Kivity <avi@scylladb.com>
Date: Tue, 12 May 2020 14:51:18 +0300
Subject: [PATCH] antlr3memory.hpp: fix for C++20 mode
gcc 10 in C++20 mode requires that the allocator type match
the type used to allocate, so do that by adding "const" to the
key type.
---
 runtime/Cpp/include/antlr3memory.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/runtime/Cpp/include/antlr3memory.hpp b/runtime/Cpp/include/antlr3memory.hpp
index 7713613..4667a00 100755
--- a/runtime/Cpp/include/antlr3memory.hpp
+++ b/runtime/Cpp/include/antlr3memory.hpp
@@ -98,17 +98,17 @@ public:
 	{
 	};
 
 	template<class KeyType, class ValueType>
 	class UnOrderedMapType : public std::map< KeyType, ValueType, std::less<KeyType>, 
-										AllocatorType<std::pair<KeyType, ValueType> > >
+										AllocatorType<std::pair<const KeyType, ValueType> > >
 	{
 	};
 
 	template<class KeyType, class ValueType>
 	class OrderedMapType : public std::map< KeyType, ValueType, std::less<KeyType>, 
-										AllocatorType<std::pair<KeyType, ValueType> > >
+										AllocatorType<std::pair<const KeyType, ValueType> > >
 	{
 	};
 
 	ANTLR_INLINE static void* operator new (std::size_t bytes)
 	{ 
-- 
2.26.2
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin