public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52136] New: g++ is wrongly propagating "friend class" to the parent class
@ 2012-02-06 13:14 sylvestre at debian dot org
  2012-02-06 13:40 ` [Bug c++/52136] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sylvestre at debian dot org @ 2012-02-06 13:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52136

             Bug #: 52136
           Summary: g++ is wrongly propagating "friend class" to the
                    parent class
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: sylvestre@debian.org


---
class address 
{
protected:
    static int parseNext(int a);
};


class mailbox : public address
{
    friend class mailboxField;
};

class mailboxField
{
    void parse(int a)
        {
            address::parseNext(a);
            // will work with:
            // mailbox::parseNext(a);
        }
};
---

It should trigger:
address.cpp: In member function ‘void mailboxField::parse(int)’:
address.cpp:4:16: error: ‘static int address::parseNext(int)’ is protected
address.cpp:17:33: error: within this context

Tested with g++ 4.6.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-02-16 13:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-06 13:14 [Bug c++/52136] New: g++ is wrongly propagating "friend class" to the parent class sylvestre at debian dot org
2012-02-06 13:40 ` [Bug c++/52136] " redi at gcc dot gnu.org
2012-02-06 13:50 ` redi at gcc dot gnu.org
2012-02-06 13:58 ` redi at gcc dot gnu.org
2012-02-06 14:09 ` sylvestre at debian dot org
2012-02-06 14:25 ` redi at gcc dot gnu.org
2014-02-16 13:17 ` jackie.rosen at hushmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).