I can see it happens when you have to use some imported C code (first typedef). So it is a bug worth to be fixed.
second typedef is obviously illegal code.
I also noticed that following are valid C++ code
struct C{
};
C C;
I didn't know that before: I thought by declaring C as a class/struct name in C++, it kind of makes it a para-keyword which forbids it be further used as identifier name.