Search

Incorrect name lookup in a lambda expression defined inside a class member function by Сыроежка

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 736295
Opened: 4/10/2012 3:48:11 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
0
User(s) can reproduce this bug
When a lambda expression is defined inside a class member function used names are not searched in the context of the lambda expression definition. That is the compiler does not start searching names inside the class.
Details (expand)

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

Visual Studio 2010 SP1

Steps to reproduce

#include "stdafx.h"

void f( int ) {}

struct
{
    void f() {}
    void g()
    {
        [=] { f(); } ();
    }
} a;

int _tmain(int argc, _TCHAR* argv[])
{
    return 0;
}

Product Language

Russian

Operating System

Windows 7

Operating System Language

Russian

Actual results

Error message

error C2660: f: функция не принимает 0 аргументов

Expected results

The code shall be compiled without any error message
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 4/11/2012 at 10:43 AM
Hi:
    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/10/2012 at 7:52 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/10/2012 at 6: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(http://support.microsoft.com)
Sign in to post a workaround.