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

Discussion in 'C++' started by sunrise@familjenjonsson.org, Mar 17, 2009.

  1. Guest

    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.
     
    , Mar 17, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Frank Drebin

    Re: fully qualified domain name

    Frank Drebin, Aug 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    617
    Frank Drebin
    Aug 26, 2003
  2. Jacob Crossley
    Replies:
    0
    Views:
    425
    Jacob Crossley
    Apr 2, 2004
  3. patrimith
    Replies:
    2
    Views:
    774
    Goldfish
    Oct 11, 2007
  4. Szabolcs Borsanyi

    Pointer to qualified poitner to qualified object

    Szabolcs Borsanyi, May 30, 2008, in forum: C Programming
    Replies:
    13
    Views:
    589
    Keith Thompson
    Jun 8, 2008
  5. winkerbean
    Replies:
    2
    Views:
    404
    winkerbean
    Oct 28, 2008
Loading...

Share This Page