Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Do base class declarations need to be fully namespace-qualified?

Reply
Thread Tools

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

 
 
sunrise@familjenjonsson.org
Guest
Posts: n/a
 
      03-17-2009
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Base class method Need base class value Karan Rajput Ruby 2 12-22-2010 04:47 PM
Are fully qualified class names permitted for ctor declarations? winkerbean C++ 2 10-28-2008 03:51 PM
template base class not fully expanded in some cases henrik.jacobsson@gmail.com C++ 2 05-21-2008 02:52 PM
Web controls declarations in base class Chris ASP .Net 0 12-15-2004 04:46 PM
Web controls declarations in base class Chris ASP .Net 1 12-14-2004 02:26 PM



Advertisments