[libc++] Resolve missing table_size symbol
authorMuiez Ahmed <muiez@ibm.com>
Thu, 18 Nov 2021 20:49:45 +0000 (15:49 -0500)
committerMuiez Ahmed <muiez@ibm.com>
Thu, 18 Nov 2021 20:49:45 +0000 (15:49 -0500)
commit049f6c29a6f0a91263588d470c1b09dccd4c70d4
treece85c0a60d736fa0e004777f07c7ba03a8be1bd5
parent46c26991ae63fd47ed11f8420cf6382989baf6bb
[libc++] Resolve missing table_size symbol

The aim of this patch is to resolve the missing `table_size` symbol (see reduced test case). That const variable is declared and defined in //libcxx/include/locale//; however, the test case suggests that the symbol is missing. This is due to a C++ pitfall (highlighted [[ https://quuxplusone.github.io/blog/2020/09/19/value-or-pitfall/ | here ]]). In summary, assigning the reference of `table_size` doesn't enforce the const-ness and expects to find `table_size` in the DLL. The fix is to use `constexpr` or have an out-of-line definition in the src (for consistency).

Differential Revision: https://reviews.llvm.org/D110647
libcxx/lib/abi/CHANGELOG.TXT
libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist
libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist
libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist
libcxx/src/locale.cpp
libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp [new file with mode: 0644]