https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100675

--- Comment #1 from 康桓瑋 <hewillk at gmail dot com> ---
(In reply to 康桓瑋 from comment #0)
> The following code fails in 10.1, 10.2, and 10.3:
> 
> https://godbolt.org/z/soGT9o4GY
> 
> #include <string_view>
> 
> template <class>
> constexpr bool g() {
>   std::string_view s = " ";
>   s.find(" ");
>   return true;
> }
> 
> constexpr bool b = g<void>();          // ok
> template <class T> concept C = g<T>();
> static_assert(C<void>);                // error

If change constexpr to consteval then compiles:

template <class>
consteval bool g() {
  std::string_view s = " ";
  s.find(" ");
  return true;
}

Reply via email to