public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/antlr3] epel10: Fix runtime support for C++20 mode (#1834782)
@ 2026-07-22 19:37 Avi Kivity
  0 siblings, 0 replies; only message in thread
From: Avi Kivity @ 2026-07-22 19:37 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/antlr3
Branch : epel10
Commit : f1bb8d639678047935e1761c3bf3c1c7da8d0f1d
Author : Avi Kivity <avi@scylladb.com>
Date   : 2020-05-12T15:16:23+03:00
Stats  : +46/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/antlr3/c/f1bb8d639678047935e1761c3bf3c1c7da8d0f1d?branch=epel10

Log:
Fix runtime support for C++20 mode (#1834782)

---
diff --git a/0006-antlr3memory.hpp-fix-for-C-20-mode.patch b/0006-antlr3memory.hpp-fix-for-C-20-mode.patch
new file mode 100644
index 0000000..fd0870c
--- /dev/null
+++ b/0006-antlr3memory.hpp-fix-for-C-20-mode.patch
@@ -0,0 +1,39 @@
+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
+

diff --git a/antlr3.spec b/antlr3.spec
index 02ac73c..79b55bf 100644
--- a/antlr3.spec
+++ b/antlr3.spec
@@ -1,7 +1,7 @@
 %global antlr_version 3.5.2
 %global c_runtime_version 3.4
 %global javascript_runtime_version 3.1
-%global baserelease 26
+%global baserelease 27
 
 Summary:            ANother Tool for Language Recognition
 Name:               antlr3
@@ -27,6 +27,8 @@ Patch3:         0003-fix-c-template.patch
 Patch4:         0004-eof-token.patch
 # Make parsers reproducible.  Patch from Debian.
 Patch5:         0005-reproducible-parsers.patch
+# Fix for C++20
+Patch6:         0006-antlr3memory.hpp-fix-for-C-20-mode.patch
 
 BuildRequires:  ant
 BuildRequires:  maven-local
@@ -143,6 +145,7 @@ sed -i "s,\${buildNumber},`cat %{_sysconfdir}/fedora-release` `date`," tool/src/
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 # remove pre-built artifacts
 find -type f -a -name *.jar -delete
@@ -278,6 +281,9 @@ install -pm 644 runtime/Cpp/include/* $RPM_BUILD_ROOT/%{_includedir}/
 %doc tool/LICENSE.txt
 
 %changelog
+* Tue May 12 2020 Avi Kivity <avi@scylladb.com> - 1:3.5.2-27
+- Fix for C++20 mode (#1834782)
+
 * Sat Apr 25 2020 Fabio Valentini <decathorpe@gmail.com> - 1:3.5.2-26
 - Remove unnecessary dependency on deprecated parent pom.
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-22 19:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-22 19:37 [rpms/antlr3] epel10: Fix runtime support for C++20 mode (#1834782) Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox