fork download
  1.  
  2. struct Interface {};
  3.  
  4. template<class T>
  5. struct Base : private T
  6. {
  7. void foo() {}
  8. };
  9.  
  10. using BaseX = Base<Interface>;
  11.  
  12. class Derived : Base<Interface>
  13. {
  14. Derived()
  15. {
  16. Base<Interface>::foo(); // Error
  17. BaseX::foo(); // Works
  18. }
  19. };
  20.  
  21. int main() {
  22. return 0;
  23. }
  24.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor 'Derived::Derived()':
prog.cpp:2:18: error: 'struct Interface Interface::Interface' is inaccessible
 struct Interface {};
                  ^
prog.cpp:16:3: error: within this context
   Base<Interface>::foo(); // Error
   ^
stdout
Standard output is empty