diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index cffc701..423c543 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -2254,7 +2254,7 @@ public: template GenericDocument& Parse(const std::basic_string& str) { - return Parse(str); + return Parse(str.c_str()); } GenericDocument& Parse(const std::basic_string& str) { diff --git a/include/rapidjson/istreamwrapper.h b/include/rapidjson/istreamwrapper.h index 9efeea2..c73586e 100644 --- a/include/rapidjson/istreamwrapper.h +++ b/include/rapidjson/istreamwrapper.h @@ -20,6 +20,11 @@ RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_OFF(padded) #endif +#ifdef _MSC_VER +RAPIDJSON_DIAG_PUSH +RAPIDJSON_DIAG_OFF(4351) // new behavior: elements of array 'array' will be default initialized +#endif + RAPIDJSON_NAMESPACE_BEGIN //! Wrapper of \c std::basic_istream into RapidJSON's Stream concept. @@ -98,7 +103,7 @@ private: typedef BasicIStreamWrapper IStreamWrapper; typedef BasicIStreamWrapper WIStreamWrapper; -#ifdef __clang__ +#if defined(__clang__) || defined(_MSC_VER) RAPIDJSON_DIAG_POP #endif diff --git a/include/rapidjson/rapidjson.h b/include/rapidjson/rapidjson.h index 13e2e24..7688c02 100644 --- a/include/rapidjson/rapidjson.h +++ b/include/rapidjson/rapidjson.h @@ -565,7 +565,7 @@ RAPIDJSON_NAMESPACE_END #if defined(__clang__) #define RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for) #elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \ - (defined(_MSC_VER) && _MSC_VER >= 1600) + (defined(_MSC_VER) && _MSC_VER >= 1700) #define RAPIDJSON_HAS_CXX11_RANGE_FOR 1 #else #define RAPIDJSON_HAS_CXX11_RANGE_FOR 0 diff --git a/test/unittest/valuetest.cpp b/test/unittest/valuetest.cpp index 8a6ac35..bcc2a0a 100644 --- a/test/unittest/valuetest.cpp +++ b/test/unittest/valuetest.cpp @@ -666,10 +666,10 @@ TEST(Value, IsLosslessDouble) { EXPECT_TRUE(Value(12.34).IsLosslessDouble()); EXPECT_TRUE(Value(-123).IsLosslessDouble()); EXPECT_TRUE(Value(2147483648u).IsLosslessDouble()); - EXPECT_TRUE(Value(static_cast(-RAPIDJSON_UINT64_C2(0x40000000, 0x00000000))).IsLosslessDouble()); + EXPECT_TRUE(Value(-static_cast(RAPIDJSON_UINT64_C2(0x40000000, 0x00000000))).IsLosslessDouble()); EXPECT_TRUE(Value(RAPIDJSON_UINT64_C2(0xA0000000, 0x00000000)).IsLosslessDouble()); - EXPECT_FALSE(Value(static_cast(-RAPIDJSON_UINT64_C2(0x7FFFFFFF, 0xFFFFFFFF))).IsLosslessDouble()); + EXPECT_FALSE(Value(-static_cast(RAPIDJSON_UINT64_C2(0x7FFFFFFF, 0xFFFFFFFF))).IsLosslessDouble()); EXPECT_FALSE(Value(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF)).IsLosslessDouble()); }