[libcxx-commits] [PATCH] D65034: [libc++] use constexpr for sizeof comparisons

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 22 09:45:04 PDT 2019


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.
Herald added a subscriber: dexonsmith.


================
Comment at: include/functional:1769
             _FunAlloc __af(__a);
-            if (sizeof(_Fun) <= sizeof(__buf_) &&
+            if _LIBCPP_CONSTEXPR_AFTER_CXX14(sizeof(_Fun) <= sizeof(__buf_) &&
                 is_nothrow_copy_constructible<_Fp>::value &&
----------------
The purpose of `_LIBCPP_CONSTEXPR_AFTER_CXX14` isn't to be used that way, it's meant for Standard Library facilities that were marked `constexpr` in C++17. I think we should have a macro specifically for constructing an `if constexpr` when supported.


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D65034





More information about the libcxx-commits mailing list