fork download
  1. #include <iostream>
  2.  
  3. template <typename T>
  4. class Test {
  5. public:
  6. template <typename A> // A == char
  7. using Wrapper = std::string;
  8.  
  9. // template <typename A> // A == char
  10. // class Wrapper : public std::string
  11. // {};
  12.  
  13. template <template <class> class C>
  14. void func(const C<T>& t) {
  15. t;
  16. return;
  17. }
  18.  
  19. void test()
  20. {
  21. std::string sss;
  22. Wrapper<char> www;
  23. func((const Wrapper<char>&)sss);
  24. }
  25. };
  26.  
  27. int main(int argc, char *argv[])
  28. {
  29. Test<char> ttt;
  30. ttt.test();
  31. }
  32.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In member function ‘void Test<T>::test() [with T = char]’:
prog.cpp:19:10: internal compiler error: Segmentation fault
     void test()
          ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
Preprocessed source stored into /home/sLPrmB/ccp5onrg.out file, please attach this to your bugreport.
stdout
Standard output is empty