fork download
  1. template <typename T> void CallBanana() { T::Banana(); }
  2. template <typename T> void CallOrange() { T::Orange(); }
  3. template <typename T> void CallUnimpl();
  4.  
  5. template <typename T>
  6. struct S {
  7. static void CallBanana() { T::Banana(); }
  8. static void CallOrange() { T::Orange(); }
  9. static void CallUnimpl();
  10. };
  11.  
  12. int main() {
  13. (void)(&CallBanana<void>);
  14. (void)(&CallOrange<void>);
  15. (void)(&CallUnimpl<void>);
  16. (void)(&S<void>::CallBanana);
  17. (void)(&S<void>::CallOrange);
  18. (void)(&S<void>::CallUnimpl);
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of ‘void CallBanana() [with T = void]’:
prog.cpp:13:33:   required from here
prog.cpp:1:47: error: incomplete type ‘void’ used in nested name specifier
prog.cpp: In instantiation of ‘void CallOrange() [with T = void]’:
prog.cpp:14:33:   required from here
prog.cpp:2:47: error: incomplete type ‘void’ used in nested name specifier
prog.cpp: In instantiation of ‘static void S<T>::CallBanana() [with T = void]’:
prog.cpp:16:26:   required from here
prog.cpp:7:36: error: incomplete type ‘void’ used in nested name specifier
prog.cpp: In instantiation of ‘static void S<T>::CallOrange() [with T = void]’:
prog.cpp:17:26:   required from here
prog.cpp:8:36: error: incomplete type ‘void’ used in nested name specifier
stdout
Standard output is empty