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:06:10 -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:06 -------
I am not quite sure about this, but here are two clues:
- for classes, we enter the namespace of the class in the argument
already, i.e.
struct X {
typedef int T;
void f(T);
};
void X::f (T) {}
is ok: in the argument list, T is a type name local to X, but we
enter that namespace already so find it. It would be consequent if
the same held for namespaces as well.
- icc says:
g/x> icc -c -Xc -ansi x.cc
x.cc(9): error: function "posix::stat" may not be redeclared in the current scope
int posix::stat(struct stat&);
^
I leave it to others to come to a final verdict.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13264