From: Christopher Dykes Date: Fri, 18 Nov 2016 23:07:58 +0000 (-0800) Subject: Disable a range test under MSVC X-Git-Tag: v2016.11.21.00~6 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=adbc74b77ca2134afb7205df718884477e30e7ce;p=folly.git Disable a range test under MSVC Summary: Because, as the comment says, MSVC fails miserably at this, producing errors at compile time. Reviewed By: yfeldblum Differential Revision: D4207544 fbshipit-source-id: d9a11b72877d22d3d3fe2e2c862d99601ab21431 --- diff --git a/folly/test/RangeTest.cpp b/folly/test/RangeTest.cpp index 827e085c..cf577f9f 100644 --- a/folly/test/RangeTest.cpp +++ b/folly/test/RangeTest.cpp @@ -1114,8 +1114,15 @@ TEST(RangeFunc, ConstexprStdArray) { static constexpr const std::array numArray = {{3, 17, 1, 9}}; constexpr const auto numArrayRange = range(numArray); EXPECT_EQ(17, numArrayRange[1]); + // MSVC 2017 RC and earlier have an issue that causes the beginning and + // end of numArrayRange to point to different copies of numArray, causing + // this attempt to calculate the size to error at compile time because + // they don't point to parts of the same array :( + // https://developercommunity.visualstudio.com/content/problem/3216/ +#if !defined(_MSC_VER) || _MSC_VER > 191024629 constexpr const auto numArrayRangeSize = numArrayRange.size(); EXPECT_EQ(4, numArrayRangeSize); +#endif } TEST(RangeFunc, ConstexprStdArrayZero) {