comparison gcc/testsuite/g++.dg/concepts/generic-fn-err.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 // { dg-do compile { target c++17 } } 1 // { dg-do compile { target c++17_only } }
2 // { dg-options "-fconcepts" } 2 // { dg-options "-fconcepts" }
3 3
4 template<typename T> 4 template<typename T>
5 concept bool C() { return __is_class(T); } 5 concept bool C() { return __is_class(T); }
6 6
8 concept bool Int() { return true; } 8 concept bool Int() { return true; }
9 9
10 template<template<typename> class X> 10 template<template<typename> class X>
11 concept bool Template() { return true; } 11 concept bool Template() { return true; }
12 12
13 void f1(Int) { } // { dg-error "does not constrain a type" }
14 void f2(Template) { } // { dg-error "does not constrain a type" }
15
13 struct S { }; 16 struct S { };
14
15 void f1(Int) { } // { dg-error "" }
16 void f2(Template) { } // { dg-error "" }
17 17
18 struct S1 { 18 struct S1 {
19 void f1(auto x) { } 19 void f1(auto x) { }
20 void f2(C x) { } 20 void f2(C x) { }
21 21