class Module { };
struct Port {
Module& owner;
Port(Module& owner) : owner(owner) {}
};
struct InPort : virtual Port { using Port::Port; };
struct OutPort : virtual Port { using Port::Port; };
struct InOutPort : InPort, OutPort { using Port::Port; };
int main() {
Module m;
InOutPort p(m);
}
Y2xhc3MgTW9kdWxlIHsgfTsKCnN0cnVjdCBQb3J0IHsKCU1vZHVsZSYgb3duZXI7CglQb3J0KE1vZHVsZSYgb3duZXIpIDogb3duZXIob3duZXIpIHt9Cn07CgpzdHJ1Y3QgSW5Qb3J0ICAgIDogdmlydHVhbCBQb3J0ICAgIHsgdXNpbmcgUG9ydDo6UG9ydDsgfTsKc3RydWN0IE91dFBvcnQgICA6IHZpcnR1YWwgUG9ydCAgICB7IHVzaW5nIFBvcnQ6OlBvcnQ7IH07CnN0cnVjdCBJbk91dFBvcnQgOiBJblBvcnQsIE91dFBvcnQgeyB1c2luZyBQb3J0OjpQb3J0OyB9OwoKaW50IG1haW4oKSB7CglNb2R1bGUgbTsKCUluT3V0UG9ydCBwKG0pOwp9
prog.cpp: In function 'int main()':
prog.cpp:14:15: error: use of deleted function 'InOutPort::InOutPort(Module&)'
InOutPort p(m);
^
prog.cpp:10:50: note: 'InOutPort::InOutPort(Module&)' is implicitly deleted because the default definition would be ill-formed:
struct InOutPort : InPort, OutPort { using Port::Port; };
^
prog.cpp:10:50: error: use of deleted function 'InPort::InPort()'
prog.cpp:8:8: note: 'InPort::InPort()' is implicitly deleted because the default definition would be ill-formed:
struct InPort : virtual Port { using Port::Port; };
^
prog.cpp:8:8: error: no matching function for call to 'Port::Port()'
prog.cpp:8:8: note: candidates are:
prog.cpp:5:2: note: Port::Port(Module&)
Port(Module& owner) : owner(owner) {}
^
prog.cpp:5:2: note: candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(const Port&)
struct Port {
^
prog.cpp:3:8: note: candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(Port&&)
prog.cpp:3:8: note: candidate expects 1 argument, 0 provided
prog.cpp:10:50: error: use of deleted function 'OutPort::OutPort()'
struct InOutPort : InPort, OutPort { using Port::Port; };
^
prog.cpp:9:8: note: 'OutPort::OutPort()' is implicitly deleted because the default definition would be ill-formed:
struct OutPort : virtual Port { using Port::Port; };
^
prog.cpp:9:8: error: no matching function for call to 'Port::Port()'
prog.cpp:9:8: note: candidates are:
prog.cpp:5:2: note: Port::Port(Module&)
Port(Module& owner) : owner(owner) {}
^
prog.cpp:5:2: note: candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(const Port&)
struct Port {
^
prog.cpp:3:8: note: candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(Port&&)
prog.cpp:3:8: note: candidate expects 1 argument, 0 provided
prog.cpp:10:50: error: no matching function for call to 'Port::Port()'
struct InOutPort : InPort, OutPort { using Port::Port; };
^
prog.cpp:10:50: note: candidates are:
prog.cpp:5:2: note: Port::Port(Module&)
Port(Module& owner) : owner(owner) {}
^
prog.cpp:5:2: note: candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(const Port&)
struct Port {
^
prog.cpp:3:8: note: candidate expects 1 argument, 0 provided
prog.cpp:3:8: note: constexpr Port::Port(Port&&)
prog.cpp:3:8: note: candidate expects 1 argument, 0 provided