Search

Nested lambdas can not refer to outer types by Kaba_

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 735281
Opened: 4/3/2012 10:26:26 AM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
0
User(s) can reproduce this bug
A lambda inside a lambda can not refer to the types defined outside the outer lambda.
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling version

Visual Studio 2010 SP1

Steps to reproduce

int main()
{
    typedef int C;

    auto f = [&]()
    {
        auto g = [&]() {C b;};
    };

    return 0;
}

Product Language

English

Operating System

Windows XP

Operating System Language

English

Actual results

Compiler errors.

Expected results

Compiles.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 4/5/2012 at 11:22 AM
Hi Kaba:
    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 MS-Moderator07 [Feedback Moderator] on 4/3/2012 at 7:40 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 MS-Moderator01 on 4/3/2012 at 10:46 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.