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++/13264] New: Function name completely hides struct in outer scope


The following code results in a pretty unintellegible diagnostic message:

parser.cc:9: error: `int posix::stat(stat&)' should have been declared inside
`posix'

struct stat { };

int stat(struct stat*);

namespace posix {
  int stat(struct stat&);
}

int posix::stat(struct stat&);

The code compiles when I replace "struct stat" with "struct ::stat".  According
to my interpretation of the name lookup rules in the standard, the code is
correct (but I'm still learning).  In this case, the bug would be a regression
from 3.3.

-- 
           Summary: Function name completely hides struct in outer scope
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fw at deneb dot enyo dot de
                CC: gcc-bugs at gcc dot gnu dot org


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


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