From e12b711a7cd92c88bd5a85142ebcaf1ea505bb33 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Fri, 12 Jul 2019 15:31:52 -0700 Subject: [PATCH 1/3] Remove invalid static_assert(false). --- Release/include/cpprest/streams.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Release/include/cpprest/streams.h b/Release/include/cpprest/streams.h index bfeeee5885..a9f43aaf7d 100644 --- a/Release/include/cpprest/streams.h +++ b/Release/include/cpprest/streams.h @@ -528,9 +528,12 @@ class type_parser public: static pplx::task parse(streams::streambuf buffer) { - typename _type_parser_integral_traits::_is_integral ii; - typename _type_parser_integral_traits::_is_unsigned ui; - return _parse(buffer, ii, ui); + typedef typename _type_parser_integral_traits::_is_integral ii; + typedef typename _type_parser_integral_traits::_is_unsigned ui; + + static_assert(ii::value || !ui::value, "type is not supported for extraction from a stream"); + + return _parse(buffer, ii{}, ui{}); } private: @@ -539,15 +542,6 @@ class type_parser _parse_floating_point(buffer); } - static pplx::task _parse(streams::streambuf, std::false_type, std::true_type) - { -#ifdef _WIN32 - static_assert(false, "type is not supported for extraction from a stream"); -#else - throw std::runtime_error("type is not supported for extraction from a stream"); -#endif - } - static pplx::task _parse(streams::streambuf buffer, std::true_type, std::false_type) { return type_parser::parse(buffer).then([](pplx::task op) -> T { From 63afb90f977649ae4c5c74df415a2a0c945f3794 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Fri, 12 Jul 2019 15:36:02 -0700 Subject: [PATCH 2/3] Turn on permissive-. --- Release/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt index 9a0bbf1a24..b9e6d6d56a 100644 --- a/Release/CMakeLists.txt +++ b/Release/CMakeLists.txt @@ -188,6 +188,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if (WINDOWS_STORE OR WINDOWS_PHONE) add_compile_options(/ZW) endif() + + if (NOT (MSVC_VERSION LESS 1920)) + add_compile_options(/permissive-) + endif() else() message("-- Unknown compiler, success is doubtful.") message("CMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID}") From f3dbbf18d2e98e5bce3a6ebc5b11aa85b9a07ad2 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Fri, 12 Jul 2019 15:41:39 -0700 Subject: [PATCH 3/3] clang-format --- Release/include/cpprest/streams.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Release/include/cpprest/streams.h b/Release/include/cpprest/streams.h index a9f43aaf7d..08713226b7 100644 --- a/Release/include/cpprest/streams.h +++ b/Release/include/cpprest/streams.h @@ -531,9 +531,9 @@ class type_parser typedef typename _type_parser_integral_traits::_is_integral ii; typedef typename _type_parser_integral_traits::_is_unsigned ui; - static_assert(ii::value || !ui::value, "type is not supported for extraction from a stream"); + static_assert(ii::value || !ui::value, "type is not supported for extraction from a stream"); - return _parse(buffer, ii{}, ui{}); + return _parse(buffer, ii {}, ui {}); } private: