Do base class declarations need to be fully namespace-qualified?

S

sunrise

Hi,

I'm having a problem with the IBM Visual Age compiler (xlC) rejecting
the following code:

namespace mcrx {
class a;
class b;
}
class mcrx::a {};
class mcrx::b : public a {};

with the error:

"test.cc", line 6.24: 1540-0063 (S) The text "a" is unexpected.

It requires that "public a" be qualified as "public mcrx::a". My
understanding is that since b is in namespace mcrx, the compiler
should look in that namespace for a match to the base class a. gcc,
intel, and Comeau accept the code even in strict mode. Can anyone tell
me who is right?

Thanks,

/Patrik J.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top