[all-commits] [llvm/llvm-project] 0da95a: [libc++] Workaround non-constexpr std::exchange pr...

Louis Dionne via All-commits all-commits at lists.llvm.org
Tue Jul 13 07:51:28 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0da95a5cf2691c8e01ae02f108487c397ab7e0ce
      https://github.com/llvm/llvm-project/commit/0da95a5cf2691c8e01ae02f108487c397ab7e0ce
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2021-07-13 (Tue, 13 Jul 2021)

  Changed paths:
    M libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/explicit_optional_U.pass.cpp

  Log Message:
  -----------
  [libc++] Workaround non-constexpr std::exchange pre C++20

std::exchange is only constexpr in C++20 and later. We were using it
in a constructor marked unconditionally constexpr, which caused issues
when building with -std=c++17.

The weird part is that the issue only showed up when building on the
arm64 macs, but that must be caused by the specific version of Clang
used on those. Since the code is clearly wrong and the fix is obvious,
I'm not going to investigate this further.




More information about the All-commits mailing list