fork download
  1. struct B {
  2. B () {}
  3. B(int i) {}
  4. };
  5.  
  6. struct D : B {
  7. using B::B;
  8. D(const char* p) {}
  9. };
  10.  
  11. int main () {
  12. D d1; // ok
  13. D d2(3); // ok
  14. D d3("hello"); // ok
  15. }
  16.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7:12: error: ‘B::B’ names constructor
prog.cpp: In function ‘int main()’:
prog.cpp:12:5: error: no matching function for call to ‘D::D()’
prog.cpp:12:5: note: candidates are:
prog.cpp:8:3: note: D::D(const char*)
prog.cpp:8:3: note:   candidate expects 1 argument, 0 provided
prog.cpp:6:8: note: constexpr D::D(const D&)
prog.cpp:6:8: note:   candidate expects 1 argument, 0 provided
prog.cpp:6:8: note: constexpr D::D(D&&)
prog.cpp:6:8: note:   candidate expects 1 argument, 0 provided
prog.cpp:13:9: error: invalid conversion from ‘int’ to ‘const char*’ [-fpermissive]
prog.cpp:8:3: error:   initializing argument 1 of ‘D::D(const char*)’ [-fpermissive]
stdout
Standard output is empty