Use a constexpr char* under MSVC for the constexpr StringPiece test
authorChristopher Dykes <cdykes@fb.com>
Mon, 22 Aug 2016 21:15:39 +0000 (14:15 -0700)
committerFacebook Github Bot 4 <facebook-github-bot-4-bot@fb.com>
Mon, 22 Aug 2016 21:23:30 +0000 (14:23 -0700)
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

folly/test/RangeTest.cpp

index 294659c90d621ad7e5775cf5f459164b1e55aff8..0a1d03ace08a1b1b8b3270c1f59115c1fdd1b7e3 100644 (file)
@@ -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");