Summary:
GCC & Clang allow the use of a non-captured constexpr local within a lambda, MSVC does not.
All 3 compilers allow this when the local has static storage.
Reviewed By: yfeldblum
Differential Revision:
D4675147
fbshipit-source-id:
3e07eb77731cbd3ebda6aee4b0b57ac19ac34de5
TEST(EliasFanoCoding, defaultNumLowerBits) {
// Verify that slowDefaultNumLowerBits and optimized
// Encoder::defaultNumLowerBits agree.
- constexpr size_t kNumIterations = 2500;
+ static constexpr size_t kNumIterations = 2500;
auto compare = [](size_t upperBound, size_t size) {
using Encoder = EliasFanoEncoderV2<size_t>;
EXPECT_EQ(int(slowDefaultNumLowerBits(upperBound, size)),