From: Christopher Dykes Date: Mon, 22 Aug 2016 21:15:39 +0000 (-0700) Subject: Use a constexpr char* under MSVC for the constexpr StringPiece test X-Git-Tag: v2016.08.29.00~27 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=07c7cdeebc61e9640d4b94d28eca6879c471bbdc;p=folly.git Use a constexpr char* under MSVC for the constexpr StringPiece test Summary: MSVC can't handle the array as a constexpr value, but works fine with the char*. Reviewed By: yfeldblum Differential Revision: D3705189 fbshipit-source-id: e8208b3f2831a720095641f0e1e72ac63ed845a0 --- diff --git a/folly/test/RangeTest.cpp b/folly/test/RangeTest.cpp index 294659c9..0a1d03ac 100644 --- a/folly/test/RangeTest.cpp +++ b/folly/test/RangeTest.cpp @@ -293,7 +293,7 @@ TEST(StringPiece, InvalidRange) { EXPECT_THROW(a.subpiece(6), std::out_of_range); } -constexpr char helloArray[] = "hello"; +constexpr const char* helloArray = "hello"; TEST(StringPiece, Constexpr) { constexpr StringPiece hello1("hello");