https://bugs.llvm.org/show_bug.cgi?id=47174

            Bug ID: 47174
           Summary: ICE with concepts
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangb...@nondot.org
          Reporter: l...@marehr.dialup.fu-berlin.de
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Hi clang-team,

(maybe you find a better summary)

the following code ICEs

```c++
#include <vector>
namespace ranges {
template <bool> struct if_then { template <typename T> using apply = T; };
template <typename I> char is_std_iterator_traits_specialized_impl_(void *);
template <typename I>
inline constexpr bool is_std_iterator_traits_specialized_v = 1 ==
sizeof(is_std_iterator_traits_specialized_impl_<I>(static_cast<std::iterator_traits<I>
*>(nullptr)));
} // namespace ranges
namespace concepts {
template <typename T, typename U>
using common_reference_t = decltype(true ? std::declval<T &>() : std::declval<T
&>());

template <typename T, typename U>
concept common_reference_with = requires()
{
  typename common_reference_t<T, U>;
};
} // namespace concepts
namespace ranges {
template <typename R>
using iter_value_t = typename
if_then<is_std_iterator_traits_specialized_v<R>>::template
apply<std::iterator_traits<R>>::value_type;

template <typename T>
concept input_range = ::concepts::common_reference_with<char &,
iter_value_t<typename T::iterator> &>;
} // namespace ranges
namespace seqan3 {
template <typename rng_t>
concept sequence = ranges::input_range<rng_t> && std::is_same_v<rng_t,
std::vector<char>>;

template <typename type>
struct debug_stream_printer;
} // namespace seqan3

template <typename rng_t> concept any_type = true;

namespace seqan3 {
template <ranges::input_range rng_t>
requires any_type<rng_t>
struct debug_stream_printer<rng_t> {};

template <sequence sequence_t>
requires any_type<sequence_t>
struct debug_stream_printer<sequence_t> {};
} // namespace seqan3

int main()
{
  seqan3::debug_stream_printer<std::vector<char>>{};
}
```

https://godbolt.org/z/fj9E73

with

> clang++-git -std=c++2a ./ice.cpp

This code is a reduction from code that uses the ranges-v3 library.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to