fork download
  1. struct a {
  2. int i;
  3.  
  4. a(int i)
  5. : i(i)
  6. {
  7. }
  8. };
  9.  
  10. struct b: a {
  11. using a::a;
  12. };
  13.  
  14. int main() {
  15. a aa(a(4));
  16. b c(a(6));
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:16:13: error: no matching function for call to ‘b::b(a)’
     b c(a(6));
             ^
prog.cpp:16:13: note: candidates are:
prog.cpp:11:14: note: b::b(int)
     using a::a;
              ^
prog.cpp:11:14: note:   no known conversion for argument 1 from ‘a’ to ‘int’
prog.cpp:10:8: note: constexpr b::b(const b&)
 struct b: a {
        ^
prog.cpp:10:8: note:   no known conversion for argument 1 from ‘a’ to ‘const b&’
prog.cpp:10:8: note: constexpr b::b(b&&)
prog.cpp:10:8: note:   no known conversion for argument 1 from ‘a’ to ‘b&&’
stdout
Standard output is empty