c++: change -fconcepts to mean C++20 concepts
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / inherit-ctor1.C
blob98c260c89b959e3b1978d49f5bf8e485b9c8ada7
1 // { dg-do compile { target c++17_only } }
2 // { dg-options "-fconcepts-ts" }
4 template<typename T>
5   concept bool C = __is_class(T);
7 struct X { };
9 template<typename T>
10   struct Base {
11     Base(double) requires C<T> { } 
12   };
14 struct Ok1 : Base<X> {
15   using Base<X>::Base;
18 struct Err1 : Base<int> {
19   using Base<int>::Base;
22 template<typename T>
23   struct Generic : Base<T> {
24     using Base<T>::Base;
25   };
28 int main() {
29   Ok1 x1(0.0);
30   Err1 x2(0.0); // { dg-error "no matching" }
31   Generic<X> x3(0.0);
32   Generic<int> x4(0.0); // { dg-error "no matching" }