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 :(


-- 
           Summary: typeof(*(struct undefined *)) fails to compile
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rusty at rustcorp dot com dot au


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44257

Reply via email to