illegal use of local type in template instantiation - by Sai Jagannath

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 714524 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 12/18/2011 7:30:56 AM
Access Restriction Public


The code below does not compile.

std::vector<int> ints;
std::map<int, int> m;

std::for_each(ints.begin(), ints.end(), [&m](int x)

It compiles in g++4.6.1. Is this a bug in VC11 ?


Sign in to post a comment.
Posted by Microsoft on 1/9/2012 at 4:36 PM
Hi: this issue has been fixed. The fix should show up in a future release of Visual C++.

Thank you for reporting the issue.

Jonathan Caves
Visual C++ Compiler Team
Posted by Microsoft on 12/22/2011 at 1:54 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 Sai Jagannath on 12/21/2011 at 5:10 AM
With "Disable Language Extensions" set to Yes, the above code fails to compile. If set to No, then the code compiles.

Posted by Microsoft on 12/20/2011 at 11:57 PM
Additionally, please provide us with a screenshot to show the error results.
Posted by EricLeong [Feedback Moderator] on 12/19/2011 at 1:04 AM
Thank you for reporting this issue. In order to research the issue reported, we must first reproduce in our labs. Unfortunately, we are unable to reproduce the issue with the steps you provided.

Could you please provide us with a sample project zip for further investigating?

It would be greatly appreciated if you could provide us this information as quickly as possible.

Thank you
Posted by MS-Moderator01 on 12/18/2011 at 7:42 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(