Visual C++ 2013: initializer_list + unique_ptr causes heap corruption - by HeTo

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 812287 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 12/24/2013 3:08:05 PM
Access Restriction Public


(I couldn't find a place to report bugs specifically for the C++ compiler and libraries; please move this to a more appropriate connect if needed.)

I have a class which wraps an std::unique_ptr, and which implements copying by copying the pointed-to object. When instances of this class are put into an std::initializer_list, the program crashes due to heap corruption when the initializer_list is destroyed. I will attach sample code demonstrating this issue; at least in the sample code, copies need to be made before the corruption is noticed.
Sign in to post a comment.
Posted by Deon [MSFT] on 6/6/2014 at 9:53 AM
Thank you for using Visual Studio and for reporting this bug. We are happy to let you know that this issue has been fixed in Visual Studio 2013 Update 2. If you already have Visual Studio 2013, you can upgrade to Update 2 for free or you can install a trial version from:
Posted by Xiang [MSFT] on 1/16/2014 at 11:44 AM
    Thanks for reporting the issue.
    A fix for this issue has been checked into the compiler sources. The fix should show up in the future release of Visual C++.

Xiang Fan
Visual C++ Team
Posted by Microsoft on 12/24/2013 at 6:47 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 12/24/2013 at 3:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(