Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 7 years ago

Language

Compiler

Options

Author

anonymous

almost 7 years ago

$
prog.cc: In substitution of 'template<class T, class> void f() [with T = int; <template-parameter-1-2> = <missing>]':
prog.cc:7:16:   required from here
prog.cc:1:19: error: type 'int' argument given to 'delete', expected pointer
 template<class T, class = decltype(delete T())>
                   ^~~~~
prog.cc: In substitution of 'template<class T, class> void f() [with T = int (*)(); <template-parameter-1-2> = <missing>]':
prog.cc:8:21:   required from here
prog.cc:1:19: error: cannot delete a function.  Only pointer-to-objects are valid arguments to 'delete'
prog.cc: In substitution of 'template<class T, class> void f() [with T = void*; <template-parameter-1-2> = <missing>]':
prog.cc:9:18:   required from here
prog.cc:1:19: warning: deleting 'void*' is undefined [-Wdelete-incomplete]
prog.cc:9:18: error: call of overloaded 'f<void*>()' is ambiguous
 int z = f<void*>();
                  ^
prog.cc:2:6: note: candidate: 'void f() [with T = void*; <template-parameter-1-2> = void]'
 void f();
      ^
prog.cc:4:5: note: candidate: 'int f(...) [with T = void*]'
 int f(...);
     ^
Exit Code:
1