1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2 // expected-no-diagnostics
4 #if !__has_feature(cxx_access_control_sfinae)
5 # error No support for access control as part of SFINAE?
9 typedef char (&no_type
)[2];
11 template<unsigned N
> struct unsigned_c
{ };
14 class has_copy_constructor
{
17 template<typename U
> static yes_type
check(unsigned_c
<sizeof(U(t
))> * = 0);
18 template<typename U
> static no_type
check(...);
21 static const bool value
= (sizeof(check
<T
>(0)) == sizeof(yes_type
));
26 struct HasNonConstCopy
{
27 HasNonConstCopy(HasNonConstCopy
&);
30 struct HasDeletedCopy
{
31 HasDeletedCopy(const HasDeletedCopy
&) = delete;
34 struct HasPrivateCopy
{
36 HasPrivateCopy(const HasPrivateCopy
&);
39 int check0
[has_copy_constructor
<HasCopy
>::value
? 1 : -1];
40 int check1
[has_copy_constructor
<HasNonConstCopy
>::value
? 1 : -1];
41 int check2
[has_copy_constructor
<HasDeletedCopy
>::value
? -1 : 1];
42 int check3
[has_copy_constructor
<HasPrivateCopy
>::value
? -1 : 1];