struct A {};
typedef A B;
struct C { friend struct B; };
GCC 4.7.0 20110427 tells me error: using typedef-name 'B' after 'struct'
.
So far, this seems pretty self-explanatory; after all, my example code is trying to declare-and-friend a struct
called B, which is in fact not a struct-key
.
However, I have to write friend struct A;
if A
is in fact a complex, long-winded mess of template metahackery, this is not desirable.
Am I missing something, or can we in fact not friend
types through type aliases? If not, is there any particular reason or is it just a quirk of the language?
This question brought up the issue before, but is dated and makes assertions on the matter regarding C++0x that don't appear to be true. This question instead regards the C++0x FDIS.