Index: libcxx/include/__locale =================================================================== --- libcxx/include/__locale +++ libcxx/include/__locale @@ -712,9 +712,9 @@ static locale::id id; #ifdef _CACHED_RUNES - static const size_t table_size = _CACHED_RUNES; + static _LIBCPP_CONSTEXPR const size_t table_size = _CACHED_RUNES; #else - static const size_t table_size = 256; // FIXME: Don't hardcode this. + static _LIBCPP_CONSTEXPR const size_t table_size = 256; // FIXME: Don't hardcode this. #endif _LIBCPP_INLINE_VISIBILITY const mask* table() const _NOEXCEPT {return __tab_;} static const mask* classic_table() _NOEXCEPT; Index: libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// template <> class ctype + +// UNSUPPORTED: c++03, c++11, c++14 + +#include +#include + +#include "test_macros.h" + +int main(int, char**) +{ + typedef std::ctype F; + const size_t *G = &F::table_size; + assert(*G >= 256); + + return 0; +}