diff options
author | Arthur O'Dwyer <arthur.j.odwyer@gmail.com> | 2021-12-05 10:08:05 -0500 |
---|---|---|
committer | Arthur O'Dwyer <arthur.j.odwyer@gmail.com> | 2021-12-06 11:20:08 -0500 |
commit | dcdb07abce278a65e1a8df164ce9b942da6ebd23 (patch) | |
tree | 26c020f97104fcb5b0be61f7d26ba343d2b32c78 /llvm/lib/CodeGen/MachinePipeliner.cpp | |
parent | f6ba6450396ce58212f247c72d84a54efd748b38 (diff) | |
download | llvm-dcdb07abce278a65e1a8df164ce9b942da6ebd23.zip llvm-dcdb07abce278a65e1a8df164ce9b942da6ebd23.tar.gz llvm-dcdb07abce278a65e1a8df164ce9b942da6ebd23.tar.bz2 |
[libc++] Work around a Clang bug in transform_view, and regression-test.
Clang trunk rejects the new test case, but this is a Clang bug
(PR47414, 47509, 50864, 44833).
```
In module 'std' imported from /Users/aodwyer/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp:17:
/Users/aodwyer/llvm-project/build2/include/c++/v1/__ranges/transform_view.h:85:44: error: constraints not satisfied for alias template 'range_reference_t' [with _Rp = const NonConstView]
regular_invocable<const _Fn&, range_reference_t<const _View>>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aodwyer/llvm-project/build2/include/c++/v1/__ranges/transform_view.h:416:25: note: in instantiation of template class 'std::ranges::transform_view<NonConstView, (lambda at /Users/aodwyer/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp:73:71)>' requested here
-> decltype( transform_view(_VSTD::forward<_Range>(__range), _VSTD::forward<_Fn>(__f)))
^
```
We can work around this by adding a layer of indirection: put the
problematic constraint into a named concept and Clang becomes more
amenable to SFINAE'ing instead of hard-erroring.
Drive-by simplify `range.transform/general.pass.cpp` to make it clearer
what it's actually testing in this area.
Differential Revision: https://reviews.llvm.org/D115116
Diffstat (limited to 'llvm/lib/CodeGen/MachinePipeliner.cpp')
0 files changed, 0 insertions, 0 deletions