fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. struct hoge{
  6. class hage{
  7. int k;
  8. friend struct hoge;
  9. };
  10.  
  11. class hige{
  12. hige(){ hage().k; }
  13. };
  14.  
  15. void moge(){ hage().k; }
  16. };
  17.  
  18. hoge::hige a;
  19. }
Compilation error #stdin compilation error #stdout 0s 3292KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12:3: error: ‘main()::hoge::hige::hige()’ is private
   hige(){ hage().k; }
   ^
prog.cpp:18:13: error: within this context
  hoge::hige a;
             ^
stdout
Standard output is empty