User account creation filtered due to spam.

Bug 44257

Summary: typeof(*(struct undefined *)) fails to compile
Product: gcc Reporter: rusty
Component: cAssignee: Not yet assigned to anyone <unassigned>
Status: UNCONFIRMED ---    
Severity: normal CC: gcc-bugs
Priority: P3    
Version: 4.4.3   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description rusty 2010-05-24 00:29:46 UTC
struct foo; 
typeof(struct foo) *p; // This is fine.
typeof(*p) *p2; // foo.c:5: error: dereferencing pointer to incomplete type

This is important, because AFAICT the only way to declare a const pointer for a given type is: "const typeof(*p) *" which doesn't work if p is a pointer to an undefined struct :(