Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/concepts/partial-spec4.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// { dg-do compile { target c++17 } } // { dg-options "-fconcepts" } template <class T> concept bool is_int = __is_same_as(T,int); template <class T> struct A { }; template <is_int T> struct A<T*> { typedef int I1; static const A<T*>::I1 j1 = 0; static int f(); }; template <is_int T> int A<T*>::f() { A<T*>::I1 i; return j1; } template <class T> struct A<T*> { typedef int I2; static const A<T*>::I2 j2 = 0; static int f(); }; template <class T> int A<T*>::f() { A<T*>::I2 i; return j2; } const int i1 = A<int*>::j1; const int i2 = A<float*>::j2; template <class T> struct B; template <is_int T> struct B<T> { typedef int I4; static const B<T>::I4 j4 = 0; static int f(); }; template <is_int T> int B<T>::f() { B<T>::I4 i; return j4; } template <class T> struct B { typedef int I5; static const B<T>::I5 j5 = 0; static int f(); }; template <class T> int B<T>::f() { B<T>::I5 i; return j5; } int i4 = B<int>::j4; int i5 = B<float>::j5; int main() { B<int>::f(); B<float>::f(); }