public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* namespace and class within with similar name
@ 2008-08-04 23:03 Alexander Werth
  2008-08-05 11:44 ` John Love-Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Werth @ 2008-08-04 23:03 UTC (permalink / raw)
  To: gcc-help

Hi,

I have the following code and I wonder why C++ complains.

namespace S {

class L;
class S;

}

using namespace S;

class C {
    void m(::S::L *l) {};
};

$ g++ main.5.cpp
main.5.cpp:12: error: ‘struct S::S::L’ has not been declared

Shouldn't it be clear that I wan't to access class L in
namespace S and not some L of class S in namespace S ?

Couriously I only get this error on some compilers:
gcc 4.1 and gcc 4.2.3 produce this error while
gcc 3.2.2 and xlc work as expected.

Any idea besides complaining about why I want to do this at all ? ;)

Alexander



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-05 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-04 23:03 namespace and class within with similar name Alexander Werth
2008-08-05 11:44 ` John Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).