Home | History | Annotate | Download | only in class.access

Lines Matching defs:Private

12 class Private {} PrivateInst;
20 private:
21 void foo(Private&); // expected-note 2 {{declared private here}}
27 op->foo(PrivateInst); // expected-error {{'foo' is a private member}}
31 void (A::*c)(Private&) = &A::foo; // expected-error {{'foo' is a private member}}
50 private:
51 void operator+(Private&); // expected-note {{declared private here}}
52 void operator[](Private&); // expected-note {{declared private here}}
53 void operator()(Private&); // expected-note {{declared private here}}
54 void operator-(); // expected-note {{declared private here}}
55 typedef void (*PrivateSurrogate)(Private&);
56 operator PrivateSurrogate() const; // expected-note {{declared private here}}
60 void operator+(const A &, Private&);
63 void test(A &a, Public &pub, Protected &prot, Private &priv) {
66 a + priv; // expected-error {{'operator+' is a private member}}
69 a[priv]; // expected-error {{'operator[]' is a private member}}
72 a(priv); // expected-error {{'operator()' is a private member}}
73 -a; // expected-error {{'operator-' is a private member}}
83 ca(priv); // expected-error {{'operator void (*)(class Private &)' is a private member}}
90 private:
91 A(); // expected-note 3 {{declared private here}}
96 A a; // expected-error {{calling a private constructor}}
99 class B : A { }; // expected-error {{base class 'test2::A' has private default constructor}}
107 class D : C { }; // expected-error {{inherited virtual base class 'test2::A' has private default constructor}}
114 private:
115 ~A(); // expected-note 2 {{declared private here}}
119 A a; // expected-error {{variable of type 'test3::A' has private destructor}}
123 A local; // expected-error {{variable of type 'test3::A' has private destructor}}
126 template <unsigned N> class Base { ~Base(); }; // expected-note 14 {{declared private here}}
127 class Base2 : virtual Base<2> { ~Base2(); }; // expected-note 3 {{declared private here}} \
128 // expected-error {{base class 'Base<2>' has private destructor}}
129 class Base3 : virtual Base<3> { public: ~Base3(); }; // expected-error {{base class 'Base<3>' has private destructor}}
135 class Derived2 : // expected-error {{inherited virtual base class 'Base<2>' has private destructor}} \
136 // expected-error {{inherited virtual base class 'Base<3>' has private destructor}}
137 Base<0>, // expected-error {{base class 'Base<0>' has private destructor}}
138 virtual Base<1>, // expected-error {{base class 'Base<1>' has private destructor}}
139 Base2, // expected-error {{base class 'test3::Base2' has private destructor}}
145 class Derived3 : // expected-error 2 {{inherited virtual base class 'Base<2>' has private destructor}} \
146 // expected-error 2 {{inherited virtual base class 'Base<3>' has private destructor}} \
148 Base<0>, // expected-error 2 {{base class 'Base<0>' has private destructor}}
149 virtual Base<1>, // expected-error 2 {{base class 'Base<1>' has private destructor}}
150 Base2, // expected-error 2 {{base class 'test3::Base2' has private destructor}}
160 private:
161 operator Private(); // expected-note 4 {{declared private here}}
166 class Derived1 : private Base { // expected-note 2 {{declared private here}} \
167 // expected-note {{constrained by private inheritance}}
168 Private test1() { return *this; } // expected-error {{'operator Private' is a private member}}
171 Private test1(Derived1 &d) { return d; } // expected-error {{'operator Private' is a private member}} \
172 // expected-error {{cannot cast 'test4::Derived1' to its private base class}}
173 Public test2(Derived1 &d) { return d; } // expected-error {{cannot cast 'test4::Derived1' to its private base class}} \
174 // expected-error {{'operator Public' is a private member}}
178 Private test1() { return *this; } // expected-error {{'operator Private' is a private member}}
181 Private test1(Derived2 &d) { return d; } // expected-error {{'operator Private' is a private member}}
184 class Derived3 : private Base { // expected-note {{constrained by private inheritance here}} \
185 // expected-note {{declared private here}}
187 operator Private();
189 Private test1(Derived3 &d) { return d; }
190 Public test2(Derived3 &d) { return d; } // expected-error {{'operator Public' is a private member of 'test4::Base'}} \
191 // expected-error {{cannot cast 'test4::Derived3' to its private base class}}
195 operator Private();
197 Private test1(Derived4 &d) { return d; }
204 void operator=(const A &); // expected-note 2 {{implicitly declared private here}}
207 class Test1 { A a; }; // expected-error {{private member}}
213 class Test2 : A {}; // expected-error {{private member}}
224 private: A(const A &); // expected-note 2 {{declared private here}}
227 class Test1 { A a; }; // expected-error {{field of type 'test6::A' has private copy constructor}}
232 class Test2 : A {}; // expected-error {{base class 'test6::A' has private copy constructor}}
267 // Don't silently upgrade forbidden-access paths to private.
272 class B : private A { // expected-note {{constrained by private inheritance here}}
275 static int getX() { return x; } // expected-error {{'x' is a private member of 'test9::A'}}
282 value = 10 // expected-note {{declared private here}}
289 value = A::value // expected-error {{'value' is a private member of 'test10::A'}}
347 private: ~A(); // expected-note {{declared private here}}
352 foo(); // expected-error {{temporary of type 'test14::A' has private destructor}}
356 ~X(); // expected-note {{declared private here}}
364 const X &xr = Y1(); // expected-error{{temporary of type 'test14::X' has private destructor}}
371 private:
372 int private_foo; // expected-note {{declared private here}}
373 static int private_sfoo; // expected-note {{declared private here}}
379 return a.private_foo; // expected-error {{private member}}
383 return a.private_sfoo; // expected-error {{private member}}
426 class A { ~A(); }; // expected-note 2{{declared private here}}
427 void b() { throw A(); } // expected-error{{temporary of type 'test16::A' has private destructor}} \
428 // expected-error{{exception object of type 'test16::A' has private destructor}}
434 template <typename T> class Inner { }; // expected-note {{declared private here}}
437 A::Inner<int> s; // expected-error {{'Inner' is a private member of 'test17::A'}}
465 Foo(); // expected-note {{implicitly declared private here}}
470 Foo a; // expected-error {{calling a private constructor}}
478 class Inner; // expected-note {{implicitly declared private here}}
488 A<int>::Inner i; // expected-error {{'Inner' is a private member}}
494 struct B : private A { using A::operator bool; };