http://llvm.org/bugs/show_bug.cgi?id=10954

           Summary: Incorrectly building an initializer for every union
                    member
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


clang tries to create an implicit initializer for every member of a union:

$ cat union.cpp
struct S { S(char); };

union U {
  S s; int n;
  U() : n(0) {}
};
$ clang++ -std=c++0x union.cpp
union.cpp:5:3: error: constructor for 'U' must explicitly initialize the member
     's' which does not have a default constructor
  U() : n(0) {}
  ^
union.cpp:4:5: note: member is declared here
  S s; int n;
    ^
union.cpp:1:8: note: 'S' declared here
struct S { S(char); };
       ^

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to