seqan / seqan3

The modern C++ library for sequence analysis. Contains version 3 of the library and API docs.
https://www.seqan.de
Other
411 stars 82 forks source link

[libc++] std::result_of_t was removed in C++20 #3207

Closed yurivict closed 1 year ago

yurivict commented 1 year ago

Does this problem persist on the current master?

Is there an existing issue for this?

Current Behavior

/usr/local/bin/ccache /usr/local/llvm17/bin/clang++ -DSEQAN3_HAS_BZIP2=1 -DSEQAN3_HAS_ZLIB=1 -I/usr/ports/biology/seqan/work/seqan3-3.3.0-49-g64a431380/test/include -I/usr/ports/biology/seqan/work/seqan3-3.3.0-49-g64a431380/include -isystem /usr/ports/biology/seqan/work/seqan3-3.3.0-49-g64a431380/submodules/sdsl-lite/include -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -DNDEBUG -pedantic -Wall -Wextra -Werror -std=c++20 -pthread -MD -MT alignment/decorator/CMakeFiles/gap_decorator_test.dir/gap_decorator_test.cpp.o -MF alignment/decorator/CMakeFiles/gap_decorator_test.dir/gap_decorator_test.cpp.o.d -o alignment/decorator/CMakeFiles/gap_decorator_test.dir/gap_decorator_test.cpp.o -c /usr/ports/biology/seqan/work/seqan3-3.3.0-49-g64a431380/test/unit/alignment/decorator/gap_decorator_test.cpp
In file included from /usr/ports/biology/seqan/work/seqan3-3.3.0-49-g64a431380/test/unit/alignment/decorator/gap_decorator_test.cpp:19:
In file included from /usr/ports/biology/seqan/work/seqan3-3.3.0-49-g64a431380/test/unit/alignment/decorator/../../alignment/aligned_sequence_test_template.hpp:19:
In file included from /usr/ports/biology/seqan/work/seqan3-3.3.0-49-g64a431380/include/seqan3/io/sam_file/detail/cigar.hpp:24:
/usr/ports/biology/seqan/work/seqan3-3.3.0-49-g64a431380/include/seqan3/io/views/detail/take_until_view.hpp:57:44: error: no member named 'result_of_t' in namespace 'std'
   57 |     static_assert(std::convertible_to<std::result_of_t<fun_t && (std::ranges::range_reference_t<urng_t>)>, bool>,
      |                                       ~~~~~^
/usr/ports/biology/seqan/work/seqan3-3.3.0-49-g64a431380/include/seqan3/io/views/detail/take_until_view.hpp:57:56: error: 'fun_t' does not refer to a value
   57 |     static_assert(std::convertible_to<std::result_of_t<fun_t && (std::ranges::range_reference_t<urng_t>)>, bool>,
      |                                                        ^
/usr/ports/biology/seqan/work/seqan3-3.3.0-49-g64a431380/include/seqan3/io/views/detail/take_until_view.hpp:50:46: note: declared here
   50 | template <std::ranges::view urng_t, typename fun_t, bool or_throw, bool and_consume>
      |                                              ^
/usr/ports/biology/seqan/work/seqan3-3.3.0-49-g64a431380/include/seqan3/io/views/detail/take_until_view.hpp:57:105: error: expected expression
   57 |     static_assert(std::convertible_to<std::result_of_t<fun_t && (std::ranges::range_reference_t<urng_t>)>, bool>,
      |                                                                                                         ^
3 errors generated.

Expected Behavior

n/a

Steps To Reproduce

n/a

Environment

- Operating system: FreeBSD 13.2
- SeqAn version: 3.3.0-49-g64a431380
- Compiler: clang-17

Anything else?

This feature was removed in C++20, see here.

eseiler commented 1 year ago

Hey there,

thank you for the report!

result_of_t has also been deprecated since c++17, so I'll also have to investigate why our CI didn't catch that (at least clang warns, and did so in other projects).

eseiler commented 1 year ago

The fix for this specific error is easy enough: https://github.com/seqan/seqan3/pull/3208

The general problem is that we only test libstdc++ (gcc) and not libc++ (llvm). Our clang CI uses by default libstdc++.

I'll check whether SeqAn3 works with libc++, or rather whether it can be made to do so; but currently we can only guarantee that it works with libstdc++.

eseiler commented 1 year ago

3209 should make the unit tests compile. I am still working on the other test suites.