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

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top