Bug#984186: libloki: ftbfs with GCC-11
Package: libloki
Version: 0.1.7-3
Followup-For: Bug #984186
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch
X-Debbugs-Cc: slyon@ubuntu.com
Control: tags -1 patch
Dear Maintainer,
GCC 11 defaults to C++17 which does not allow dynamic exception specifications
anymore: https://gcc.gnu.org/gcc-11/porting_to.html
In Ubuntu, the attached patch was applied to replace the throw(...)
specifications in the recommended way:
* Fix FTBFS with GCC-11 by avoiding dynamic exception specifications
Thanks for considering the patch.
Cheers,
Lukas
-- System Information:
Debian Release: 11.0
APT prefers impish
APT policy: (500, 'impish')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.13.0-16-generic (SMP w/4 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE:en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
only in patch2:
unchanged:
--- libloki-0.1.7.orig/include/loki/SmallObj.h
+++ libloki-0.1.7/include/loki/SmallObj.h
@@ -459,7 +459,7 @@
/// @note MSVC complains about non-empty exception specification lists.
static void * operator new ( std::size_t size )
#else
- static void * operator new ( std::size_t size ) throw ( std::bad_alloc )
+ static void * operator new ( std::size_t size ) noexcept(false)
#endif
{
typename MyThreadingModel::Lock lock;
@@ -468,7 +468,7 @@
}
/// Non-throwing single-object new returns NULL if allocation fails.
- static void * operator new ( std::size_t size, const std::nothrow_t & ) throw ()
+ static void * operator new ( std::size_t size, const std::nothrow_t & ) noexcept
{
typename MyThreadingModel::Lock lock;
(void)lock; // get rid of warning
@@ -482,7 +482,7 @@
}
/// Single-object delete.
- static void operator delete ( void * p, std::size_t size ) throw ()
+ static void operator delete ( void * p, std::size_t size ) noexcept
{
typename MyThreadingModel::Lock lock;
(void)lock; // get rid of warning
@@ -512,8 +512,7 @@
/// @note MSVC complains about non-empty exception specification lists.
static void * operator new [] ( std::size_t size )
#else
- static void * operator new [] ( std::size_t size )
- throw ( std::bad_alloc )
+ static void * operator new [] ( std::size_t size ) noexcept(false)
#endif
{
typename MyThreadingModel::Lock lock;
@@ -523,7 +522,7 @@
/// Non-throwing array-object new returns NULL if allocation fails.
static void * operator new [] ( std::size_t size,
- const std::nothrow_t & ) throw ()
+ const std::nothrow_t & ) noexcept
{
typename MyThreadingModel::Lock lock;
(void)lock; // get rid of warning
@@ -537,7 +536,7 @@
}
/// Array-object delete.
- static void operator delete [] ( void * p, std::size_t size ) throw ()
+ static void operator delete [] ( void * p, std::size_t size ) noexcept
{
typename MyThreadingModel::Lock lock;
(void)lock; // get rid of warning
Reply to: