This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51584] New: Errorneous compilation when deriving from an inaccessible friend class.
- From: "prasoonsaurav.nit at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 16 Dec 2011 18:21:57 +0000
- Subject: [Bug c++/51584] New: Errorneous compilation when deriving from an inaccessible friend class.
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51584
Bug #: 51584
Summary: Errorneous compilation when deriving from an
inaccessible friend class.
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: prasoonsaurav.nit@gmail.com
struct A {
private:
class face;
friend class face;
};
struct A::face {};
template <typename _CharT>
struct C : public A::face
{};
int main()
{
C<int> x;
}
gets compiled on g++ 4.6.1.
It shouldn't because
"A name nominated by a friend declaration shall be
accessible in the scope of the class containing the friend
declaration" [11.4.7]
A::face is inaccessible at the point of derivation. Comeau issues an error
message.