public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29040]  New: missing access control checks in subclasses for nested types
@ 2006-09-12 20:03 amylaar at gcc dot gnu dot org
  2006-09-12 20:59 ` [Bug c++/29040] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 9+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-09-12 20:03 UTC (permalink / raw)
  To: gcc-bugs

The following should not compile:

struct c
{
private:struct n
  {
    int j;
  };
};

struct d:public c
{
  void f (struct n *p);
};

According to 9.2 ; 1, nested types are class members. 11 ; 4 says that member
access control does not affect visibility, only access. If an inaccessible
member name is used, the program is ill-formed.

FWIW, g++ will also accept if you declare a data member of type struct n in d.


-- 
           Summary: missing access control checks in subclasses for nested
                    types
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: amylaar at gcc dot gnu dot org


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


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

end of thread, other threads:[~2024-02-16 18:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-29040-4@http.gcc.gnu.org/bugzilla/>
2013-10-14 18:05 ` [Bug c++/29040] missing access control checks in subclasses for nested types paolo.carlini at oracle dot com
2014-04-22 11:37 ` jakub at gcc dot gnu.org
2014-07-16 13:31 ` jakub at gcc dot gnu.org
2014-10-30 10:43 ` jakub at gcc dot gnu.org
2015-06-26 20:04 ` jakub at gcc dot gnu.org
2015-06-26 20:32 ` jakub at gcc dot gnu.org
2015-06-26 21:18 ` pinskia at gcc dot gnu.org
2024-02-16 18:08 ` mpolacek at gcc dot gnu.org
2006-09-12 20:03 [Bug c++/29040] New: " amylaar at gcc dot gnu dot org
2006-09-12 20:59 ` [Bug c++/29040] " pinskia at gcc dot gnu dot org

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).