fix Clang CI warnings

This commit is contained in:
Crzyrndm 2018-07-21 12:33:58 +12:00
parent ad24d9485d
commit fede2d3168
2 changed files with 2 additions and 8 deletions

View File

@ -37,15 +37,8 @@ namespace xlnt {
template <typename T>
class optional
{
#if _MSC_VER <= 1900 // v14, visual studio 2015
#if defined(_MSC_VER) && _MSC_VER <= 1900 // v14, visual studio 2015
#define XLNT_NOEXCEPT_VALUE_COMPAT(...) (false)
using ctor_copy_T_noexcept = std::false_type;
using ctor_move_T_noexcept = std::false_type;
using copy_ctor_noexcept = ctor_copy_T_noexcept;
using move_ctor_noexcept = ctor_move_T_noexcept;
using set_copy_noexcept_t = std::false_type;
using set_move_noexcept_t = std::false_type;
using clear_noexcept_t = std::false_type;
#else
#define XLNT_NOEXCEPT_VALUE_COMPAT(...) (__VA_ARGS__)
using ctor_copy_T_noexcept = typename std::conditional<std::is_nothrow_copy_constructible<T>{}, std::true_type, std::false_type>::type;

View File

@ -41,6 +41,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-padded") # ignore padding warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-documentation-unknown-command") # ignore unknown commands in Javadoc-style comments
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") # ignore Windows and GCC pragmas
set CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option") # ignore Windows and GCC pragmas
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-float-equal") # don't warn on uses of == for fp types
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-newline-eof") # no longer an issue with post-c++11 standards which mandate include add a newline if neccesary
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-covered-switch-default") # default is often added to switches for completeness or to cover future alternatives