comparison gcc/testsuite/g++.dg/concepts/iconv1.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 // PR c++/67240
2 // { dg-options "-std=c++17 -fconcepts" }
3
4 int foo(int x)
5 {
6 return x;
7 }
8
9 template <typename T>
10 concept bool C1 = requires (T x) {
11 {foo(x)} -> int&;
12 };
13
14 template <typename T>
15 concept bool C2 = requires (T x) {
16 {foo(x)} -> void;
17 };
18
19 static_assert( C1<int> ); // { dg-error "assert" }
20 static_assert( C2<int> ); // { dg-error "assert" }