* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / deleted9.C
blobaf97be7c35eff3fa2f5e706ab933261788b92731
1 // PR c++/64352
2 // { dg-do compile { target c++11 } }
4 template<bool B> struct bool_type
5 { static constexpr bool value = B; };
7 using true_type = bool_type<true>;
8 using false_type = bool_type<false>;
10 template<typename T> T&& declval();
12 template<typename...> struct void_ { using type = void; };
13 template<typename... I> using void_t = typename void_<I...>::type;
15 template<typename _Tp, typename = void>
16 struct _Has_addressof_free: false_type { };
18 template<typename _Tp>
19 struct _Has_addressof_free
20 <_Tp, void_t<decltype( operator&(declval<const _Tp&>()) )>>
21 : true_type { };
23 struct foo {};
24 void operator&(foo) = delete;
26 int main()
28     static_assert( !_Has_addressof_free<int>::value, "" );
29     // error: use of deleted function 'void operator&(foo)'
30     static_assert( !_Has_addressof_free<foo>::value, "" );