On Wed, Nov 14, 2012 at 6:10 PM, Piotr Wyderski
<piotr.wyderski@gmail.com> wrote:
The following snippet:
class A {};
class B : public A {
typedef A super;
public:
class X {};
};
class C : public B {
typedef B super;
class X : public super::X {
typedef super::X super;
};
};
compiles without a warning on Comeau and MSVC, but GCC (4.6.1 and
4.7.1) failes with the following message:
$ gcc -c bug.cpp
bug.cpp:18:24: error: declaration of âtypedef class B::X C::X::superâ
[-fpermissive]
bug.cpp:14:14: error: changes meaning of âsuperâ from âtypedef class B
C::superâ [-fpermissive]
Should I file a report?
Best regards, Piotr
Here's a two-line TC:
typedef struct { typedef int type; } s1;
struct S2 { s1::type s1; };
Fails with GCC 4.6.3; succeeds with clang 3.0. Looks like a bug to me.
/Ulf