fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct X
  5. {
  6. explicit X(int x = 1, int y = 1)
  7. {
  8. }
  9. };
  10.  
  11. int main() {
  12. X x;
  13. X x1 = 1;
  14. X x2(2, 3);
  15.  
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 5540KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:13:9: error: conversion from ‘int’ to non-scalar type ‘X’ requested
  X x1 = 1;
         ^
stdout
Standard output is empty