[libcxx-commits] [PATCH] D103558: Remove VLA from libcxx locale header

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 3 09:39:17 PDT 2021


Quuxplusone accepted this revision.
Quuxplusone added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libcxx/include/locale:1463
     // printed as an unsigned value.
-    const unsigned __nbuf = (numeric_limits<unsigned long>::digits / 3)          // 1 char per 3 bits
-                            + ((numeric_limits<unsigned long>::digits % 3) != 0) // round up
-                            + ((__iob.flags() & ios_base::showbase) != 0)        // base prefix
-                            + 1;                                                 // terminating null character
+    _LIBCPP_CONSTEXPR const unsigned __nbuf
+        = (numeric_limits<unsigned long>::digits / 3)        // 1 char per 3 bits
----------------
I wonder if this should be `_LIBCPP_CONSTEXPR const` (which seems redundant) or merely `static const` (for C++03 compatibility) or merely `const`. But I guess as long as it compiles it's fine any way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103558



More information about the libcxx-commits mailing list