#include <iostream> struct A { int x; int y; }; struct B : private A { using A::x; }; int main() { B b; std::cout << b.x << std::endl; std::cout << b.y << std::endl; // should fail }
Standard input is empty
prog.cpp: In function 'int main()': prog.cpp:6:6: error: 'int A::y' is inaccessible prog.cpp:19:17: error: within this context
Standard output is empty