This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17353] New: type name in nested class conflicts with name in outer class


The following code does not compile:

--------------------------------------------------
struct cause_error
{
  typedef int type;
  struct nested { typedef type type; };
};
--------------------------------------------------
jeff.cc:4: error: declaration of `typedef int cause_error::nested::type'
jeff.cc:3: error: changes meaning of `type' from `typedef int cause_error::type'

I am fairly positive it is legal code, though. It never compiled on any version 
of GCC so far.

-- 
           Summary: type name in nested class conflicts with name in outer
                    class
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: giovannibajo at libero dot it
                CC: gcc-bugs at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]