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

             Bug #: 11418
           Summary: Non-static data member initializers not ignored in
                    default copy constructor
           Product: clang
           Version: unspecified
          Platform: All
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Created attachment 7634
  --> http://llvm.org/bugs/attachment.cgi?id=7634
Test compilation file

In Apple clang version 3.0, 

When a non-static data member initializer exists, its value appears to be used
as that data member's "right-hand-side" in the default copy constructor
generated for the struct/class.  Currently the bug only repros for non-POD
structs, since PODs appear to be bitwise copied.  The attached files "test.cpp"
when compiled with the accompanying instructions in the comments, produces
varying output depending on whether the variable string1 is commented out or
not.

According to Section 12.8.6 or the standard,

ยง 12.8:

-6. The implicitly-defined copy/move constructor for a non-union class X
performs a memberwise copy/move of its bases and members. [ Note:
brace-or-equal-initializers of non-static data members are ignored. ...] ...

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