This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67595] concepts code causes segfault


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

--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
template <class X> concept bool allocatable = requires{ { new X }->X * };
template <class X> concept bool semiregular = allocatable<X>;
template <class X> concept bool readable = requires{ requires semiregular<X> };
template <class X> int weak_input_iterator = requires (X x){ { x }->readable };
template <class X> concept bool input_iterator{ weak_input_iterator<X> };
template <class X>
concept bool forward_iterator = requires{ requires input_iterator<X> };
template <class X>
concept bool bidirectional_iterator = requires{ requires forward_iterator<X> };
template <class X>
concept bool random_access_iterator
    = requires{ requires bidirectional_iterator<X> };
void fn1 (random_access_iterator);
int
main ()
{
  int v;
  fn1 (v);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]