fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. enum Mutability {Const, Non_Const};
  5.  
  6. template <typename T, Mutability U>
  7. class Obj
  8. {
  9. public:
  10. template <Mutability V>
  11. class Ref
  12. {
  13. public:
  14. Ref() {}
  15.  
  16. friend class Obj;
  17. };
  18.  
  19. Obj() {}
  20. };
  21.  
  22. template <typename T>
  23. class Obj<T, Const>::Ref<Non_Const>
  24. {
  25. private:
  26. Ref() {}
  27. }; //error C1001: An internal error has occurred in the compiler
  28.  
  29. int main()
  30. {
  31. Obj<int, Const>::Ref<Non_Const> test;
  32. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:23:22: error: 'Ref' is not a class template
 class Obj<T, Const>::Ref<Non_Const>
                      ^
prog.cpp:24:1: error: qualified name does not name a class before '{' token
 {
 ^
stdout
Standard output is empty