[cfe-dev] using stmt + friend

Vassil Vassilev vasil.georgiev.vasilev at cern.ch
Fri Mar 28 03:03:28 PDT 2014


Hi,
cat T.h

namespace N {
    struct A {
       friend struct B;
    };
}

namespace M {
    struct B{};
}
namespace N {
    using M::B;
}

If I compile this with clang (close to trunk) it is all good: clang 
-fsyntax-only -x c++ T.h
If I compile it with gcc (4.8.1): g++ -fsyntax-only -x c++ T.h
T.h:11:17: error: ‘B’ is already declared in this scope
     using M::B;
                  ^
My question is if this is a bug in clang or in gcc (so that I know where 
to submit it to).

Vassil



More information about the cfe-dev mailing list