view gcc/testsuite/g++.dg/cpp2a/concepts-spec1.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

// Example from CA 104 proposal.
// { dg-do compile { target concepts } }

template <class T> concept C = sizeof(T) == 8;
template <class T> struct A {
  template <class U> U f(U) requires C<typename T::type>; // #1
  template <class U> U f(U) requires C<T>; // #2
};

template <> template <class U> U A<int>::f(U) requires C<int> { } // OK, specializes #2