using enum from another namespace

Discussion in 'C++' started by Old Wolf, Mar 29, 2005.

  1. Old Wolf

    Old Wolf Guest

    My compiler chokes on the following code:

    namespace foo
    {
    typedef enum E { buz, baz } E;
    };
    namespace bar
    {
    using foo::E;
    };

    (it says "Multiple declaration for enum foo::E").
    If I change the typedef to "typedef enum E { buz, baz } F;"
    then there is no problem with either "using foo::E" or "using foo::F".

    Is this a compiler bug? I am working around it by not typedeffing
    the enums (They were in a header file which was to be used from both
    C and C++).
    Old Wolf, Mar 29, 2005
    #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. -

    enum within an enum

    -, Jun 12, 2005, in forum: Java
    Replies:
    6
    Views:
    525
  2. Jerminia
    Replies:
    3
    Views:
    615
    Roedy Green
    Oct 7, 2005
  3. Jason Heyes
    Replies:
    1
    Views:
    443
    Woebegone
    Nov 19, 2004
  4. Replies:
    1
    Views:
    502
    George Bina
    Jul 20, 2006
  5. mrhicks
    Replies:
    2
    Views:
    404
    Dave Thompson
    Jun 10, 2004
Loading...

Share This Page