1 // PR c++/59483 2 // { dg-do compile { target c++11 } } 3 4 struct X 5 { 6 protected: 7 int i; 8 }; 9 10 struct Y : X 11 { YY12 Y() 13 { 14 [&]{ X::i = 3; }(); 15 } 16 }; 17 18 template <class T> 19 struct Y2 : T 20 { Y2Y221 Y2() 22 { 23 [&]{ T::i = 3; }(); 24 } 25 }; 26 main()27int main() 28 { 29 Y y; 30 Y2<X> y2; 31 } 32