shared_ptr and lambda function crash with C1001 - by 8Ika1oikXJA8H

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 706674 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 11/20/2011 3:25:08 PM
Access Restriction Public


#include <memory>
// this code generates a C1001
// but comment the line defining data and uncomment the line above and it compiles
// this construct is important for passing data when persistence is an issue in multithreading
int main()
	//typedef int data;
	struct data {};
	std::shared_ptr<data> p = std::shared_ptr<data>(new data);
	[=](){data& record = *p;};
	return 0;
Sign in to post a comment.
Posted by Microsoft on 4/29/2014 at 12:24 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from:
Posted by Microsoft on 11/21/2011 at 11:10 AM
    A fix for this issue has been checked into the compiler sources. The fix should show up in the next release of Visual C++.

Xiang Fan
Visual C++ Team
Posted by EricLeong [Feedback Moderator] on 11/20/2011 at 7:24 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.
Posted by MS-Moderator01 on 11/20/2011 at 3:44 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(