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] Function name completely hides struct in outer scope


------- 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


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