This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/13287] New: Union with anonymous struct as member in gcc3.3


I just get a program with gcc3.3 in MAC. The simplified test case as following: 
( note the struct inside union is anonymous)

union A{
   struct B{
      int x;
   };
};

int main() {

union A aa;
aa.x = 10;     
return 0;
}

In MAC using gcc 3.3, get the error:

jamesren% gcc -c t.c
t.c:4: warning: declaration does not declare anything
t.c: In function `main':
t.c:9: error: union has no member named `x'

But it passed with gcc 3.2.

-- 
           Summary: Union with anonymous struct as member in gcc3.3
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zhixingr at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]