1 // RUN: %clang_cc1 -fsyntax-only -verify %s
5 ConstCopy
&operator=(const ConstCopy
&);
10 NonConstCopy
&operator=(NonConstCopy
&);
13 struct VirtualInheritsNonConstCopy
: virtual NonConstCopy
{
14 VirtualInheritsNonConstCopy();
15 VirtualInheritsNonConstCopy
&operator=(const VirtualInheritsNonConstCopy
&);
18 struct ImplicitNonConstCopy1
: NonConstCopy
{ // expected-note{{the implicit copy assignment operator}}
19 ImplicitNonConstCopy1();
22 struct ImplicitNonConstCopy2
{ // expected-note{{the implicit copy assignment operator}}
23 ImplicitNonConstCopy2();
27 struct ImplicitNonConstCopy3
{ // expected-note{{the implicit copy assignment operator}}
28 ImplicitNonConstCopy3();
29 NonConstCopy ncc_array
[2][3];
32 struct ImplicitNonConstCopy4
: VirtualInheritsNonConstCopy
{
33 ImplicitNonConstCopy4();
36 void test_non_const_copy(const ImplicitNonConstCopy1
&cincc1
,
37 const ImplicitNonConstCopy2
&cincc2
,
38 const ImplicitNonConstCopy3
&cincc3
,
39 const ImplicitNonConstCopy4
&cincc4
,
40 const VirtualInheritsNonConstCopy
&vincc
) {
41 (void)sizeof(ImplicitNonConstCopy1() = cincc1
); // expected-error{{no viable overloaded '='}}
42 (void)sizeof(ImplicitNonConstCopy2() = cincc2
); // expected-error{{no viable overloaded '='}}
43 (void)sizeof(ImplicitNonConstCopy3() = cincc3
); // expected-error{{no viable overloaded '='}}
44 (void)sizeof(ImplicitNonConstCopy4() = cincc4
); // okay
45 (void)sizeof(VirtualInheritsNonConstCopy() = vincc
);