-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
| Bugzilla Link | 11418 |
| Resolution | FIXED |
| Resolved on | Nov 28, 2011 14:03 |
| Version | unspecified |
| OS | MacOS X |
| Attachments | Test compilation file |
| CC | @DougGregor |
Extended Description
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. ...] ...