prog.cpp: In function ‘int main()’:
prog.cpp:17:14: error: ‘A::Key::Key()’ is private within this context
A a2(A::Key(), 5); // this doesn't
^
prog.cpp:8:3: note: declared private here
Key() {}
^~~
prog.cpp:17:18: error: ‘A::Key::Key(const A::Key&)’ is private within this context
A a2(A::Key(), 5); // this doesn't
^
prog.cpp:9:3: note: declared private here
Key(Key const &) {}
^~~
prog.cpp:12:2: note: initializing argument 1 of ‘A::A(A::Key, int)’
A(Key key, int a = 5) {}
^