summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/concepts/iconv1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/concepts/iconv1.C')
-rw-r--r--gcc/testsuite/g++.dg/concepts/iconv1.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/concepts/iconv1.C b/gcc/testsuite/g++.dg/concepts/iconv1.C
new file mode 100644
index 00000000000..c4dd38fe5b4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/concepts/iconv1.C
@@ -0,0 +1,20 @@
+// PR c++/67240
+// { dg-options -std=c++1z }
+
+int foo(int x)
+{
+ return x;
+}
+
+template <typename T>
+concept bool C1 = requires (T x) {
+ {foo(x)} -> int&;
+};
+
+template <typename T>
+concept bool C2 = requires (T x) {
+ {foo(x)} -> void;
+};
+
+static_assert( C1<int> ); // { dg-error "assert" }
+static_assert( C2<int> ); // { dg-error "assert" }