[all-commits] [llvm/llvm-project] 13f557: [libc++] Make std::bind constexpr-friendly

Louis Dionne via All-commits all-commits at lists.llvm.org
Wed May 3 09:27:35 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 13f5579caeee2c75baf1249b9f64de54f7c361e2
      https://github.com/llvm/llvm-project/commit/13f5579caeee2c75baf1249b9f64de54f7c361e2
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2023-05-03 (Wed, 03 May 2023)

  Changed paths:
    M libcxx/include/__functional/bind.h
    M libcxx/include/__functional/invoke.h
    A libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/PR23141.pass.cpp
    R libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/PR23141_invoke_not_constexpr.pass.cpp
    M libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp
    M libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
    M libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp
    M libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp

  Log Message:
  -----------
  [libc++] Make std::bind constexpr-friendly

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.

Differential Revision: https://reviews.llvm.org/D149295




More information about the All-commits mailing list