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 +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 UnOrderedMapType : public std::map< KeyType, ValueType, std::less, +- AllocatorType > > ++ AllocatorType > > + { + }; + + template + class OrderedMapType : public std::map< KeyType, ValueType, std::less, +- AllocatorType > > ++ AllocatorType > > + { + }; + + 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 - 1:3.5.2-27 +- Fix for C++20 mode (#1834782) + * Sat Apr 25 2020 Fabio Valentini - 1:3.5.2-26 - Remove unnecessary dependency on deprecated parent pom.