* doc/invoke.texi: Document -std=c++17 and -std=gnu++17 and document
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / partial-spec4.C
blob5669bd4ec857aa678eb3d42b794133a01aded8ee
1 // { dg-options "-std=c++17 -fconcepts" }
3 template <class T> concept bool is_int = __is_same_as(T,int);
5 template <class T> struct A { };
6 template <is_int T> struct A<T*> {
7   typedef int I1;
8   static const A<T*>::I1 j1 = 0;
9   static int f();
11 template <is_int T> int A<T*>::f()
12 { A<T*>::I1 i; return j1; }
14 template <class T> struct A<T*> {
15   typedef int I2;
16   static const A<T*>::I2 j2 = 0;
17   static int f();
19 template <class T> int A<T*>::f()
20 { A<T*>::I2 i; return j2; }
22 const int i1 = A<int*>::j1;
23 const int i2 = A<float*>::j2;
25 template <class T> struct B;
27 template <is_int T> struct B<T> {
28   typedef int I4;
29   static const B<T>::I4 j4 = 0;
30   static int f();
32 template <is_int T> int B<T>::f()
33 { B<T>::I4 i; return j4; }
35 template <class T> struct B {
36   typedef int I5;
37   static const B<T>::I5 j5 = 0;
38   static int f();
40 template <class T> int B<T>::f()
41 { B<T>::I5 i; return j5; }
43 int i4 = B<int>::j4;
44 int i5 = B<float>::j5;
45 int main()
47   B<int>::f();
48   B<float>::f();