summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/concepts/iconv1.C
blob: 28f3566d4178809a46d20f61380df1fa48aa8735 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// PR c++/67240
// { dg-options "-std=c++1z -fconcepts" }

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" }