[Bug c++/13857] nested namespaces error msg

gdr at integrable-solutions dot net gcc-bugzilla@gcc.gnu.org
Sun Jan 25 15:55:00 GMT 2004


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



More information about the Gcc-bugs mailing list