[all-commits] [llvm/llvm-project] 049f6c: [libc++] Resolve missing table_size symbol

muiez via All-commits all-commits at lists.llvm.org
Thu Nov 18 12:52:05 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 049f6c29a6f0a91263588d470c1b09dccd4c70d4
      https://github.com/llvm/llvm-project/commit/049f6c29a6f0a91263588d470c1b09dccd4c70d4
  Author: Muiez Ahmed <muiez at ibm.com>
  Date:   2021-11-18 (Thu, 18 Nov 2021)

  Changed paths:
    M libcxx/lib/abi/CHANGELOG.TXT
    M libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist
    M libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist
    M libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist
    M libcxx/src/locale.cpp
    A libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list