Kaydet (Commit) f89f9aa6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

With GCC -std=gnu++17, dynamic exception specifications cause an error

...instead of a warning (as with Clang), so this follow-up to
e16644fa "external/mysqlcppconn: Silence
-Wdynamic-exception-spec errors" patches the (few) dynamic exception
specifications out of external/mysqlcppconn completely

Change-Id: I83a42f1c09e60c15fad1564cf7c42eb3370485da
üst 9d2721b1
......@@ -58,15 +58,6 @@ $(eval $(call gb_Library_add_libs,mysqlcppconn,\
))
endif
# Avoid -Wdynamic-exception-spec errors in Clang C++17 mode:
ifeq ($(COM_IS_CLANG),TRUE)
$(eval $(call gb_Library_add_cxxflags,mysqlcppconn, \
$(if $(filter -std=gnu++17 -std=gnu++1z -std=c++17 -std=c++1z, \
$(CXXFLAGS_CXX11)), \
-Wno-error=dynamic-exception-spec) \
))
endif
$(eval $(call gb_Library_add_generated_exception_objects,mysqlcppconn,\
UnpackedTarball/mysqlcppconn/driver/mysql_art_resultset \
UnpackedTarball/mysqlcppconn/driver/mysql_art_rset_metadata \
......
......@@ -20,6 +20,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,mysqlcppconn,\
external/mysqlcppconn/patches/mysql-connector-c++-1.1.0.patch \
external/mysqlcppconn/patches/warnings.patch.0 \
external/mysqlcppconn/patches/enable-libmysql-proxy.patch \
external/mysqlcppconn/patches/dynexcspec.patch.0 \
))
# vim: set noet sw=4 ts=4:
--- cppconn/exception.h
+++ cppconn/exception.h
@@ -36,10 +36,10 @@
{
#define MEMORY_ALLOC_OPERATORS(Class) \
- void* operator new(size_t size) throw (std::bad_alloc) { return ::operator new(size); } \
+ void* operator new(size_t size) { return ::operator new(size); } \
void* operator new(size_t, void*) throw(); \
void* operator new(size_t, const std::nothrow_t&) throw(); \
- void* operator new[](size_t) throw (std::bad_alloc); \
+ void* operator new[](size_t); \
void* operator new[](size_t, void*) throw(); \
void* operator new[](size_t, const std::nothrow_t&) throw(); \
void* operator new(size_t N, std::allocator<Class>&);
......@@ -29,14 +29,7 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"
#endif
#if defined __clang__ && __cplusplus > 201402L
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdynamic-exception-spec"
#endif
#include <cppconn/exception.h>
#if defined __clang__ && __cplusplus > 201402L
#pragma clang diagnostic pop
#endif
#if defined __GNUC__
#pragma GCC diagnostic pop
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment