This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13857] nested namespaces error msg
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jan 2004 15:55:26 -0000
- Subject: [Bug c++/13857] nested namespaces error msg
- References: <20040125154309.13857.debian-gcc@lists.debian.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2004-01-25 15:55 -------
Subject: Re: New: nested namespaces error msg
"debian-gcc at lists dot debian dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| [forwarded from http://bugs.debian.org/229088]
|
| seen in 3.3.3 and 3.4 CVS
|
| In this example the error message mentions the wrong namespace:
|
|
| namespace outer { namespace inner { void foo(); } }
|
| void outer::foo()
| {
| // error: `void outer::foo()' should have been declared inside `outer'
| }
I don't understand this report. As far as I can tell, the error
message is correct. You cannot define something as being part of a
namespace (using a qualified-id) if it wasn't previously declared
there. You can perfectly have outer::foo and outer::inner::foo.
The compiler is not telepathic.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13857