This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13264] Function name completely hides struct in outer scope
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Dec 2003 22:36:14 -0000
- Subject: [Bug c++/13264] Function name completely hides struct in outer scope
- References: <20031201215301.13264.fw@deneb.enyo.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2003-12-01 22:36 -------
What really happens is this: gcc sees something like this
---------------------
namespace posix {
int stat(double);
}
int posix::stat(int);
----------------------
i.e. two functions stat with different argument lists. That's not allowed,
though: a function declaration is only allowed from within the namespace.
So the error message you get is actually accurate:
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc:5: error: `int posix::stat(int)' should have been declared inside `posix'
The only thing is that it gets a little confusing with names of
functions and structures being the same. The icc message, btw, has
exactly the same meaning.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13264