[libcxx-commits] [PATCH] D96523: [libc++] Rewrite the tuple constructors to be strictly Standards conforming

Mikhail Maltsev via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 28 06:36:18 PDT 2021


miyuki added a comment.

Hi. It looks like this change broke the following code:

  #include <tuple>
  
  void test() {
      using pair_t = std::pair<int, char>;
      constexpr std::tuple<long, long> t(pair_t(0, 'a'));
  }



  <source>:5:38: error: constexpr variable 't' must be initialized by a constant expression
      constexpr std::tuple<long, long> t(pair_t(0, 'a'));
                                       ^~~~~~~~~~~~~~~~~
  <source>:5:38: note: non-constexpr constructor 'tuple<int, char, _And, 0>' cannot be used in a constant expression
  /opt/compiler-explorer/clang-trunk-20210428/bin/../include/c++/v1/tuple:900:5: note: declared here
      tuple(pair<_Up1, _Up2>&& __p)
      ^
  1 error generated.
  Compiler returned: 1

https://godbolt.org/z/6sd9TTMrq

Could you please have a look into it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96523



More information about the libcxx-commits mailing list