From a59f6ffc69d6b7482845b675c40f35419bde15ee Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 8 Jun 2017 15:48:15 +1000 Subject: [PATCH] build: remove explicit constexpr instantiations GCC7 no longer requires these instantiations, and in fact produces a warning/error in these cases. So we remove them. --- colour.cpp | 13 +------------ introspection.cpp | 27 +-------------------------- introspection.hpp | 10 ++-------- term.cpp | 5 +---- 4 files changed, 5 insertions(+), 50 deletions(-) diff --git a/colour.cpp b/colour.cpp index 4aaf5fb3..ff11cb4b 100644 --- a/colour.cpp +++ b/colour.cpp @@ -11,7 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * - * Copyright 2010-2016 Danny Robson + * Copyright 2010-2017 Danny Robson */ #include "./colour.hpp" @@ -441,17 +441,6 @@ util::operator>> (std::istream &is, util::colour &c) template std::istream& util::operator>> (std::istream&, util::colour<3,uint8_t>&); /////////////////////////////////////////////////////////////////////////////// -// we need to instantiate the various type_name specialisations for colour. -// -// we provide a declaration here, before then instantiating a routine that we -// know will cause an implicit instantiation (ie util::to_string) for each -// colour specialisation we require. -template -constexpr -const char util::type_name>::value[]; - - -//----------------------------------------------------------------------------- #define INSTANTIATE_S_T(S,T) \ template \ struct util::colour; \ diff --git a/introspection.cpp b/introspection.cpp index b28aad4d..cd323bbc 100644 --- a/introspection.cpp +++ b/introspection.cpp @@ -11,32 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * - * Copyright 2015-2016 Danny Robson + * Copyright 2017 Danny Robson */ #include "introspection.hpp" - - -/////////////////////////////////////////////////////////////////////////////// -constexpr const char ::util::detail::type_name_bool::value[]; -constexpr const char ::util::detail::type_name_char::value[]; -constexpr const char ::util::detail::type_name_voidp::value[]; - -constexpr const char ::util::detail::type_name_u08::value[]; -constexpr const char ::util::detail::type_name_u16::value[]; -constexpr const char ::util::detail::type_name_u32::value[]; -constexpr const char ::util::detail::type_name_u64::value[]; - -constexpr const char ::util::detail::type_name_s08::value[]; -constexpr const char ::util::detail::type_name_s16::value[]; -constexpr const char ::util::detail::type_name_s32::value[]; -constexpr const char ::util::detail::type_name_s64::value[]; - -constexpr const char ::util::detail::type_name_f32::value[]; -constexpr const char ::util::detail::type_name_f64::value[]; - -constexpr const char ::util::detail::type_name_string::value[]; -constexpr const char ::util::detail::type_name_cstring::value[]; -constexpr const char ::util::detail::type_name_const_cstring::value[]; - -constexpr const char ::util::detail::type_name_path::value[]; diff --git a/introspection.hpp b/introspection.hpp index d9d8172f..b6f83ba7 100644 --- a/introspection.hpp +++ b/introspection.hpp @@ -11,7 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * - * Copyright 2015-2016 Danny Robson + * Copyright 2015-2017 Danny Robson */ #ifndef __UTIL_INTROSPECTION_HPP @@ -173,13 +173,7 @@ namespace util { util::enum_traits<::NS::E>::value_count \ > PASTE(util::__enum_traits_,E)::names = { \ MAP(STRINGIZE_LIST, __VA_ARGS__) \ - }; \ - \ - constexpr \ - const char util::type_name<::NS::E>::ns[]; \ - \ - constexpr \ - const char util::type_name<::NS::E>::value[]; \ + }; ///------------------------------------------------------------------------ diff --git a/term.cpp b/term.cpp index 2a299a47..78ed2316 100644 --- a/term.cpp +++ b/term.cpp @@ -11,7 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * - * Copyright 2016 Danny Robson + * Copyright 2016-2017 Danny Robson */ #include "./term.hpp" @@ -24,11 +24,8 @@ using util::term::csi::graphics; - static const std::experimental::filesystem::path DEFAULT_SEARCH_DIR = "/usr/share/terminfo"; -constexpr char util::term::csi::code::CSI; - const graphics graphics::RESET (0);