visibility does not match previous declaration, again

I've run into a problem somewhat similar to

Reduced test case is:
#pragma GCC visibility push(hidden)
typedef struct foo bar;
struct __attribute__((__visibility__("default"))) foo {};

If the typedef line is commented out, then everything compiles just fine.
It was unexpected to me that typedef can have this effect, but I am not sure
what applicable standards say about this situation.

Can you open a bug?