[Bug c++/59482] New: A friend class cannot inherit a private class
ville.voutilainen at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Dec 12 12:23:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59482
Bug ID: 59482
Summary: A friend class cannot inherit a private class
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ville.voutilainen at gmail dot com
Test:
struct aa {
friend struct cc;
private:
struct bb {};
};
struct cc : aa::bb {};
Output:
ville.cpp:1:47: error: ‘struct aa::bb’ is private
struct aa { friend struct cc; private: struct bb {}; }; struct cc : aa::bb {};
^
ville.cpp:1:73: error: within this context
struct aa { friend struct cc; private: struct bb {}; }; struct cc : aa::bb {};
^
Clang 3.4 accepts the code.
More information about the Gcc-bugs
mailing list