This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67595] concepts code causes segfault
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 16 Sep 2015 07:54:46 +0000
- Subject: [Bug c++/67595] concepts code causes segfault
- Auto-submitted: auto-generated
- References: <bug-67595-4 at http dot gcc dot gnu dot org/bugzilla/>
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);
}