[libcxx-commits] [PATCH] D110647: Resolve missing table_size symbol

Muiez Ahmed via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 19 12:52:04 PDT 2021


muiez updated this revision to Diff 380760.
muiez retitled this revision from "[SystemZ][z/OS] Resolve missing table_size symbol" to "Resolve missing table_size symbol".
muiez edited the summary of this revision.
muiez added a comment.

Using out-of-line definition instead of constexpr. This way is more consistent and allows the test case to pass for standards prior to c++17.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110647/new/

https://reviews.llvm.org/D110647

Files:
  libcxx/src/locale.cpp
  libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp


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,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <> class ctype<char>
+
+#include <locale>
+#include <cassert>
+
+#include "test_macros.h"
+
+int main(int, char**)
+{
+  typedef std::ctype<char> F;
+  const size_t *G = &F::table_size;
+  assert(*G >= 256);
+
+  return 0;
+}
Index: libcxx/src/locale.cpp
===================================================================
--- libcxx/src/locale.cpp
+++ libcxx/src/locale.cpp
@@ -897,6 +897,8 @@
 
 locale::id ctype<char>::id;
 
+const size_t ctype<char>::table_size;
+
 ctype<char>::ctype(const mask* tab, bool del, size_t refs)
     : locale::facet(refs),
       __tab_(tab),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110647.380760.patch
Type: text/x-patch
Size: 1347 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211019/03dc483c/attachment.bin>


More information about the libcxx-commits mailing list