2015-04-20 Andrew Sutton <andrew.n.sutton@gmail.com>
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / req2.C
blob3c41523395924e34ce615ccbc20e0ff85170f104
1 // { dg-options "-std=c++1z" }
3 template<typename T>
4   concept bool Class () { return __is_class(T); }
6 void f1(auto a) requires Class<decltype(a)>() { }
8 // FIXME: This is generating excess errors related to pretty
9 // printing the trailing requires expression.
10 void f2(auto a)
11   requires requires (decltype(a) x) { -x; }
12 { }
14 struct S { } s;
16 int main() {
17   f1(0); // { dg-error "cannot call" }
18   f2((void*)0); // { dg-error "cannot call" }