Internal compiler error while compiling specific initializer of global object. - by Waldemar Pawlaszek

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 697512 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 10/28/2011 1:15:03 AM
Access Restriction Public


Internal compiler error occurs while compiling the following code:

#include <functional>

int fun( std::function<void()>  f )
    return 0;

int b = fun( []() { int i = 0; } );

int main()

Required elements of the bug:
1. There must be a conversion of the lambda to std::function object to match function parameters,
2. lambda passed to the function must have initialization of automatic variable.
Sign in to post a comment.
Posted by Waldemar Pawlaszek on 11/2/2011 at 1:04 AM
Thank you.

One question though. I've managed to replicate the error with similar (although little more complicated) code in VC11 Developer Preview. Does it mean that the bug has not been fixed prior to that release or this is a different issue?

Waldemar Pawlaszek

Posted by Microsoft on 11/1/2011 at 1:16 PM
    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 10/28/2011 at 2:15 AM
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 10/28/2011 at 1:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(