fork download
  1. class X
  2. {
  3. public:
  4. explicit X(int)
  5. {
  6. }
  7. };
  8.  
  9. class Y
  10. {
  11. public:
  12. Y(int)
  13. {
  14. }
  15. };
  16.  
  17. void foo(X)
  18. {
  19. }
  20.  
  21. void bar(Y)
  22. {
  23. }
  24.  
  25. int main(int, char**)
  26. {
  27. foo({ 42 });
  28. bar({ 42 });
  29.  
  30. return 0;
  31. }
  32.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main(int, char**)’:
prog.cpp:27:15: error: converting to ‘X’ from initializer list would use explicit constructor ‘X::X(int)’
     foo({ 42 });
               ^
stdout
Standard output is empty