[libcxx-commits] [PATCH] D149295: [libc++] Make std::bind constexpr-friendly

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 26 14:21:04 PDT 2023


ldionne created this revision.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

std::bind is supposed to be constexpr-friendly since C++20 and it was
marked as such in our synopsis. However, the tests were not actually
testing any of it and as it happens, std::bind was not really constexpr
friendly. This fixes the issue and makes sure that at least some of the
tests are running in constexpr mode.

Some tests for std::bind check functions that return void, and those
use global variables. These tests haven't been made constexpr-friendly,
however the coverage added by this patch should be sufficient to get
decent confidence.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149295

Files:
  libcxx/include/__functional/bind.h
  libcxx/include/__functional/invoke.h
  libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/PR23141.pass.cpp
  libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/PR23141_invoke_not_constexpr.pass.cpp
  libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp
  libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
  libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp
  libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149295.517316.patch
Type: text/x-patch
Size: 13437 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230426/8d55729f/attachment-0001.bin>


More information about the libcxx-commits mailing list