1 // { dg-do compile { target c++11 } } 2 3 struct derived; 4 struct base { 5 friend struct derived; 6 private: 7 base(); 8 }; 9 struct derived : base {}; 10 11 derived d1{}; // { dg-error "" "" { target c++17 } } 12 derived d2; // still OK 13