view gcc/testsuite/g++.dg/cpp0x/decltype74.C @ 19:2b5abeee2509 default tip

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

// PR c++/69694
// { dg-do compile { target c++11 } }

// n3911: TransformationTrait Alias `void_t`
template<typename...> struct make_void { using type = void; };
template<typename... Ts> using void_t = typename make_void<Ts...>::type;

// std::declval<void*&>
void*& declval_void();

template<typename, typename = void> struct Fun;
template<typename R>
  struct Fun<R(), void>
{
  void fun();
};
template<typename Desc>
  struct Fun<Desc, void_t<decltype (declval_void() = Desc::name)>>
    : Fun<void()>
{
};

struct Tag { static constexpr void* name = 0; };

template<typename> void a()
{
  Fun<Tag>{}.fun();
}

void b() { a<int>(); }