http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55877
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-04
17:07:55 UTC ---
The reason for listing 4.6 was that the PR54883 change has been applied to 4.6
branch fairly recently, making it for the enum case a recent 4.6 regression.
BTW, what about:
typedef struct {
typedef enum { X, Y } A;
typedef struct { } B;
struct C {
static void fn1 (B) { }
static void fn2 (C) { }
};
} D;
void foo (D) {}
void foo (D::A) {}
void foo (D::B) {}
void foo (D::C) {}
void *p = (void *) D::C::fn1;
void *q = (void *) D::C::fn2;
which is still rejected even with this patch?
error: anonymous type with no linkage used to declare function ‘static
void<anonymous struct>::C::fn1(<anonymous struct>::B)’ with linkage
[-fpermissive]
and similarly for fn2. If typedef struct { is changed to typedef struct D {
on the first line, it compiles just fine and everything is exported.