From 141c4da24ee515fcf3f6d4497c235b8c18184c86 Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 10 May 2019 19:48:31 -0400 Subject: [PATCH] cleanup some build error with ICC 2019 (issue #9) --- .travis.yml | 12 ++++++++++++ parallel_hashmap/phmap_base.h | 2 +- parallel_hashmap/phmap_config.h | 27 ++++----------------------- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index b773dd1..b6e302b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -112,6 +112,18 @@ matrix: - g++-7 env: COMPILER='clang++-5.0' CXX_FLAGS='-std=c++17' + - os: linux + compiler: clang + addons: + apt: + sources: + - llvm-toolchain-trusty-5.0 + - ubuntu-toolchain-r-test + packages: + - clang-5.0 + - g++-7 + env: COMPILER='clang++-5.0' CXX_FLAGS='-std=c++17' + dist: trusty script: diff --git a/parallel_hashmap/phmap_base.h b/parallel_hashmap/phmap_base.h index 276287b..4f0479a 100644 --- a/parallel_hashmap/phmap_base.h +++ b/parallel_hashmap/phmap_base.h @@ -2550,7 +2550,7 @@ public: template T value_or(U&& v) && { // NOLINT(build/c++11) static_assert(std::is_move_constructible::value, - "optional::value_or: T must by copy constructible"); + "optional::value_or: T must by move constructible"); static_assert(std::is_convertible::value, "optional::value_or: U must be convertible to T"); return static_cast(*this) ? std::move(**this) diff --git a/parallel_hashmap/phmap_config.h b/parallel_hashmap/phmap_config.h index b1563b4..a1705ad 100644 --- a/parallel_hashmap/phmap_config.h +++ b/parallel_hashmap/phmap_config.h @@ -554,24 +554,12 @@ #define PHMAP_ATTRIBUTE_COLD #endif -#if PHMAP_HAVE_CPP_ATTRIBUTE(clang::xray_always_instrument) && \ - !defined(PHMAP_NO_XRAY_ATTRIBUTES) - #define PHMAP_XRAY_ALWAYS_INSTRUMENT [[clang::xray_always_instrument]] - #define PHMAP_XRAY_NEVER_INSTRUMENT [[clang::xray_never_instrument]] - #if PHMAP_HAVE_CPP_ATTRIBUTE(clang::xray_log_args) - #define PHMAP_XRAY_LOG_ARGS(N) \ - [[clang::xray_always_instrument, clang::xray_log_args(N)]] +#if defined(__clang__) + #if PHMAP_HAVE_CPP_ATTRIBUTE(clang::reinitializes) + #define PHMAP_ATTRIBUTE_REINITIALIZES [[clang::reinitializes]] #else - #define PHMAP_XRAY_LOG_ARGS(N) [[clang::xray_always_instrument]] + #define PHMAP_ATTRIBUTE_REINITIALIZES #endif -#else - #define PHMAP_XRAY_ALWAYS_INSTRUMENT - #define PHMAP_XRAY_NEVER_INSTRUMENT - #define PHMAP_XRAY_LOG_ARGS(N) -#endif - -#if PHMAP_HAVE_CPP_ATTRIBUTE(clang::reinitializes) - #define PHMAP_ATTRIBUTE_REINITIALIZES [[clang::reinitializes]] #else #define PHMAP_ATTRIBUTE_REINITIALIZES #endif @@ -601,13 +589,6 @@ #define PHMAP_ATTRIBUTE_FUNC_ALIGN(bytes) #endif -#if PHMAP_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) - #define PHMAP_CONST_INIT [[clang::require_constant_initialization]] -#else - #define PHMAP_CONST_INIT -#endif // PHMAP_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) - - // ---------------------------------------------------------------------- // Figure out SSE support // ----------------------------------------------------------------------