Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/concepts/iconv1.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/67240 |
131 | 2 // { dg-do compile { target c++17 } } |
3 // { dg-options "-fconcepts" } | |
111 | 4 |
5 int foo(int x) | |
6 { | |
7 return x; | |
8 } | |
9 | |
10 template <typename T> | |
11 concept bool C1 = requires (T x) { | |
12 {foo(x)} -> int&; | |
13 }; | |
14 | |
15 template <typename T> | |
16 concept bool C2 = requires (T x) { | |
17 {foo(x)} -> void; | |
18 }; | |
19 | |
20 static_assert( C1<int> ); // { dg-error "assert" } | |
21 static_assert( C2<int> ); // { dg-error "assert" } |