Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/concepts/partial-concept-id1.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 // { dg-options "-std=c++17 -fconcepts" } | |
2 | |
3 template<typename T> | |
4 concept bool Type() { return true; } | |
5 | |
6 template<typename T, typename U> | |
7 concept bool Same() { return __is_same_as(T, U); } | |
8 | |
9 template<typename T, typename U> | |
10 concept bool C1() { return true; } | |
11 | |
12 template<typename T, typename... Args> | |
13 concept bool C2() { return true; } | |
14 | |
15 template<Same<int> T> struct S1 { }; | |
16 template<typename T, Same<T> U> struct S2 { }; | |
17 | |
18 void f(Same<int> q) { } | |
19 void g(Type a, Same<decltype(a)> b) { } | |
20 | |
21 void h0(Same<int>* a) { } | |
22 void h1(C1<int>* a) { } | |
23 void h2(C2<char, short, int, long>* a) { } | |
24 | |
25 int main() { | |
26 S1<int> s1; | |
27 S2<int, int> s2; | |
28 f(0); | |
29 g(0, 1); | |
30 h0((int*)0); | |
31 h1((int*)0); | |
32 h2((int*)0); | |
33 } |