fork(1) download
  1. #include <iostream>
  2. #include <tuple>
  3. #include <typeinfo>
  4.  
  5. struct Test
  6. {
  7. virtual ~Test() = 0;
  8. };
  9. inline Test::~Test() = default;
  10.  
  11. template<typename T>
  12. void f()
  13. {
  14. std::cout << typeid(T).name() << std::endl;
  15. }
  16.  
  17. int main()
  18. {
  19. f<std::tuple<Test>>();
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from prog.cpp:2:0:
/usr/include/c++/5/tuple: In instantiation of 'struct std::_Head_base<0u, Test, false>':
/usr/include/c++/5/tuple:339:12:   required from 'struct std::_Tuple_impl<0u, Test>'
/usr/include/c++/5/tuple:463:11:   required from 'class std::tuple<Test>'
prog.cpp:14:29:   required from 'void f() [with T = std::tuple<Test>]'
prog.cpp:19:22:   required from here
/usr/include/c++/5/tuple:147:13: error: cannot declare field 'std::_Head_base<0u, Test, false>::_M_head_impl' to be of abstract type 'Test'
       _Head _M_head_impl;
             ^
prog.cpp:5:8: note:   because the following virtual functions are pure within 'Test':
 struct Test
        ^
prog.cpp:5:8: note: 	virtual Test::~Test()
stdout
Standard output is empty