view gcc/testsuite/g++.dg/cpp2a/concepts-complete1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

// { dg-do compile { target c++2a } }

template <class T> concept has_mem_type = requires { typename T::type; };

template <has_mem_type T> int f () { return 0; }
template <class T> char f() { return 0; }

struct A;
static_assert (sizeof (f<A>()) == 1);
struct A { typedef int type; };
static_assert (sizeof (f<A>()) > 1);