From 68fa98e70e78743ec07254c3d6057095d7c5a36a Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 11 Oct 2016 21:43:28 +1100 Subject: [PATCH] build: workaround gcc synthesis constructor cast warnings --- cmdopt.hpp | 2 +- json/except.hpp | 12 +++++++++--- json/schema.cpp | 8 ++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/cmdopt.hpp b/cmdopt.hpp index ebfc0afd..079bf3e0 100644 --- a/cmdopt.hpp +++ b/cmdopt.hpp @@ -115,7 +115,7 @@ namespace util { namespace cmdopt { class bytes : public value { public: - using value::value; + bytes (size_t &_value): value (_value) { } using value::execute; void execute (const char *restrict) override; diff --git a/json/except.hpp b/json/except.hpp index 6f18f9c2..b9244480 100644 --- a/json/except.hpp +++ b/json/except.hpp @@ -24,13 +24,17 @@ namespace json { /// The base class for all exceptions throw directly by the json namespace. struct error : public std::runtime_error { - using runtime_error::runtime_error; + error (const std::string &what): + runtime_error (what) + { ; } }; /// Base class for all type conversion errors struct type_error : public error { - using error::error; + type_error (const std::string &what): + error (what) + { ; } }; @@ -47,7 +51,9 @@ namespace json { /// Base class for errors thrown during schema validation struct schema_error : public error { - using error::error; + schema_error (const std::string &what): + error (what) + { ; } }; diff --git a/json/schema.cpp b/json/schema.cpp index 63b6ab64..05fa7ffd 100644 --- a/json/schema.cpp +++ b/json/schema.cpp @@ -28,13 +28,17 @@ /////////////////////////////////////////////////////////////////////////////// struct length_error : public json::schema_error { - using schema_error::schema_error; + length_error (const std::string &what): + schema_error (what) + { ; } }; //----------------------------------------------------------------------------- struct format_error : public json::schema_error { - using schema_error::schema_error; + format_error (const std::string &what): + schema_error (what) + { ; } };