This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13264] New: Function name completely hides struct in outer scope
- From: "fw at deneb dot enyo dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Dec 2003 21:53:15 -0000
- Subject: [Bug c++/13264] New: Function name completely hides struct in outer scope
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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