[libcxx-commits] [PATCH] D65667: [libcxx] Avoid destructor call for error_category singletons

Hubert Tong via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 13 21:06:25 PDT 2022


hubert.reinterpretcast added inline comments.


================
Comment at: libcxx/src/ios.cpp:62
+    _LIBCPP_NO_DESTROY constinit
+    static IostreamErrorHelper s;
+    return s.iostream_error_category;
----------------
ldionne wrote:
> Actually, since those are `constinit`, I think we could even define them at file scope and skip the function-local static. Thoughts?
That makes sense. It does have an advantage in cases where `_LIBCPP_NO_DESTROY` is not effective.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65667



More information about the libcxx-commits mailing list