Add documentation for musttail attribute
[official-gcc.git] / gcc / testsuite / g++.dg / tc1 / dr142.C
blob6e216da89f080fef25c300576457fbc20ce5cf37
1 // { dg-do compile }
2 // Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
3 // DR142: Injection-related errors in access example 
5 class B {                 
6 public:
7   int mi;                 
8   static int si;          
9 };
11 class D: private B { // { dg-message "declared" }
14 class DD: public D {
15   void f();
18 void DD::f() {
19   mi = 3;          // { dg-error "within this context" }
20   si = 3;          // { dg-error "within this context" }
21   ::B b;
22   b.mi = 3;
23   b.si = 3;
24   ::B::si = 3;
25   ::B* bp1 = this;        // { dg-error "inaccessible base" }
26   ::B* bp2 = (::B*)this;
27   bp2->mi = 3;
30   B b2;                   // { dg-error "within this context" }
31   B::si = 3;              // { dg-error "within this context" }