Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Fixes this compile error under gcc: ``` folly/test/UtilityTest.cpp: In member function ‘virtual void UtilityTest_literal_string_Test::TestBody()’: folly/test/UtilityTest.cpp:195:57: error: ‘constexpr folly::literal_string<C, N>::literal_string(const C (&)[N]) [with C = char; long unsigned int N = 12]’ called in a constant expression 195 | constexpr auto s = folly::literal_string{"hello world"}; | ^ In file included from folly/test/UtilityTest.cpp:17: folly/Utility.h:279:34: note: ‘constexpr folly::literal_string<C, N>::literal_string(const C (&)[N]) [with C = char; long unsigned int N = 12]’ is not usable as a ‘constexpr’ function because: 279 | FOLLY_CONSTEVAL /* implicit */ literal_string(C const (&buf)[N]) noexcept { | ^~~~~~~~~~~~~~ folly/Utility.h:279:34: error: member ‘folly::literal_string<char, 12>::buffer’ must be initialized by mem-initializer in ‘constexpr’ constructor folly/Utility.h:277:5: note: declared here 277 | C buffer[N]; | ^~~~~~ ``` And add the corresponding test to the cmake build. Reviewed By: DenisYaroshevskiy Differential Revision: D62217752 fbshipit-source-id: bf2b8892b37848d3e765f6a9752d7ba7a87d5a93
- Loading branch information