Skip to content

Commit

Permalink
1. Setting -Wno-error=self-assign-overloaded only on compilers that
Browse files Browse the repository at this point in the history
require/support it.
2. Removing some pessismistic std::moves that gcc9 was complaining
about.
3. Adding newer compilers/platforms to the Travis build matrix.
  • Loading branch information
georgemp committed Jul 3, 2019
1 parent 7bd4e1c commit b1669f9
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 5 deletions.
53 changes: 52 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ env:
matrix:
include:

# check code formatting
# check code formatting
- os: linux
compiler: gcc
env: NAME="check code formatting" CHECK_FORMATTING=true
Expand Down Expand Up @@ -147,6 +147,22 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'libboost-all-dev', 'ninja-build']
env: NAME="g++-7" COMPILER=g++-7 ARCH=x86_64 CONF=Release UNIT_TESTS=true BUILD_BENCHMARKS=true

- os: linux
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-8', 'libboost-all-dev', 'ninja-build']
env: NAME="g++-8" COMPILER=g++-8 ARCH=x86_64 CONF=Release UNIT_TESTS=true BUILD_BENCHMARKS=true

- os: linux
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-9', 'libboost-all-dev', 'ninja-build']
env: NAME="g++-9" COMPILER=g++-9 ARCH=x86_64 CONF=Release UNIT_TESTS=true BUILD_BENCHMARKS=true

# Linux / CLang
- os: linux
Expand Down Expand Up @@ -198,6 +214,41 @@ matrix:
env: COMPILER=clang++-5.0 ARCH=x86_64 CONF=Release UNIT_TESTS=true

# OSX/Clang
- os: osx
osx_image: xcode10.2
compiler: clang
env: COMPILER=clang++ ARCH=x86_64 CONF=Release UNIT_TESTS=true BUILD_BENCHMARKS=false BUILD_EXAMPLES=true

- os: osx
osx_image: xcode10.1
compiler: clang
env: COMPILER=clang++ ARCH=x86_64 CONF=Release UNIT_TESTS=true BUILD_BENCHMARKS=false BUILD_EXAMPLES=true

- os: osx
osx_image: xcode10
compiler: clang
env: COMPILER=clang++ ARCH=x86_64 CONF=Release UNIT_TESTS=true BUILD_BENCHMARKS=false BUILD_EXAMPLES=true

- os: osx
osx_image: xcode9.4
compiler: clang
env: COMPILER=clang++ ARCH=x86 CONF=Release UNIT_TESTS=true BUILD_BENCHMARKS=false BUILD_EXAMPLES=true

- os: osx
osx_image: xcode9.4
compiler: clang
env: COMPILER=clang++ ARCH=x86_64 CONF=Release UNIT_TESTS=true BUILD_BENCHMARKS=false BUILD_EXAMPLES=true

- os: osx
osx_image: xcode9.3
compiler: clang
env: COMPILER=clang++ ARCH=x86 CONF=Release UNIT_TESTS=true BUILD_BENCHMARKS=false BUILD_EXAMPLES=true

- os: osx
osx_image: xcode9.3
compiler: clang
env: COMPILER=clang++ ARCH=x86_64 CONF=Release UNIT_TESTS=true BUILD_BENCHMARKS=false BUILD_EXAMPLES=true

- os: osx
osx_image: xcode9.2
compiler: clang
Expand Down
4 changes: 2 additions & 2 deletions src/rttr/detail/registration/bind_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class registration::bind<detail::ctor_func, Class_Type, F, acc_level, Visitor_Li
std::move(get_metadata(std::forward<Args>(args)...)),
std::move(get_default_args<type_list<Acc_Func>, function_type>(std::forward<Args>(args)...)),
std::move(create_param_infos<type_list<F>, function_type>(std::forward<Args>(args)...)));
return std::move(ctor);
return ctor;
}
public:
bind(const std::shared_ptr<detail::registration_executer>& reg_exec, F func)
Expand Down Expand Up @@ -678,7 +678,7 @@ class registration::bind<detail::meth, Class_Type, F, acc_level, Visitor_List> :
std::move(get_metadata(std::forward<Args>(args)...)),
std::move(get_default_args<type_list<Acc_Func>, function_type>(std::forward<Args>(args)...)),
std::move(create_param_infos<type_list<F>, function_type>(std::forward<Args>(args)...)) );
return std::move(meth);
return meth;
}

template<typename Policy, std::size_t Metadata_Count, typename...TArgs, typename...Param_Args>
Expand Down
16 changes: 14 additions & 2 deletions src/unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ add_subdirectory(base_library)
set(HPP_FILES "")
set(SRC_FILES "")

cmake_policy(SET CMP0025 NEW)
project(unit_tests LANGUAGES CXX)

message(STATUS "Scanning " ${PROJECT_NAME} " module.")
Expand All @@ -53,8 +54,19 @@ set_target_properties(unit_tests PROPERTIES DEBUG_POSTFIX ${RTTR_DEBUG_POSTFIX}
CXX_STANDARD ${MAX_CXX_STANDARD})

set_compiler_warnings(unit_tests)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0.1)
target_compile_options(unit_tests PRIVATE -Wno-error=self-assign-overloaded)

message("CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
message("CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION}")
message("XCODE_VERSION: ${XCODE_VERSION}")

if ((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "10.0.1.10010046")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "6.0.1")
OR (XCODE AND XCODE_VERSION VERSION_GREATER "10.1"))
target_compile_options(unit_tests PRIVATE -Wno-error=self-assign-overloaded)
endif()

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.1.0")
target_compile_options(unit_tests PRIVATE -Wno-error=init-list-lifetime)
endif()

if (MSVC)
Expand Down

0 comments on commit b1669f9

Please sign in to comment.