const char foo[] = "libc";
extern __typeof (foo) bar __attribute__((alias ("foo")));
int s1 = sizeof foo;
int s2 = sizeof bar;

yields

z.c:4: error: invalid application of ‘sizeof’ to incomplete type ‘const char[]’

with 4.0 and HEAD.  Compiles successfully with 3.2.3 and 3.4.4.  Also compiles
successfully with 4.0 and HEAD with -Dconst=''.  That is, the failure goes away
if we remove const from the picture.

-- 
           Summary: [4.0/4.1 regression] completed type not selected
                    properly with typeof
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rth at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,roland at redhat dot com


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

Reply via email to