aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/concepts/iconv1.C
blob: 38a0b17b1f82d76e7ff9988163bad1973a1c57e2 (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++17 -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" }