re PR c++/67595 (concepts code causes segfault)
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 30 Oct 2017 22:41:21 +0000 (22:41 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 30 Oct 2017 22:41:21 +0000 (22:41 +0000)
2017-10-30  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/67595
* g++.dg/concepts/pr67595.C: New.

From-SVN: r254245

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/concepts/pr67595.C [new file with mode: 0644]

index e17c94dc5353ac9a8255782db6d8b341ffeee6a6..33aaba8bcd1848474ae3c516c2da39fdc49bd4c6 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/67595
+       * g++.dg/concepts/pr67595.C: New.
+
 2017-10-30  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/80850
diff --git a/gcc/testsuite/g++.dg/concepts/pr67595.C b/gcc/testsuite/g++.dg/concepts/pr67595.C
new file mode 100644 (file)
index 0000000..63162fb
--- /dev/null
@@ -0,0 +1,13 @@
+// { dg-options "-std=c++17 -fconcepts" }
+
+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> int weak_input_iterator = requires{{0}->readable};
+template <class X> bool input_iterator{weak_input_iterator<X>};
+template <class X> bool forward_iterator{input_iterator<X>};
+template <class X> bool bidirectional_iterator{forward_iterator<X>};
+template <class X>
+concept bool random_access_iterator{bidirectional_iterator<X>};
+void fn1(random_access_iterator);
+int main() { fn1(0); }  // { dg-error "" }