Home Dashboard Directory Help
Search

Unexpected error C2751 reported at 'using namespace' directive inside a lambda expression. by Viorel_


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 636634
Opened: 1/18/2011 6:30:40 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

In shown situation, the 'using namespace' directive generates an error that seems to be unexpected:


namespace NamespaceA
{
    namespace NamespaceB
    {
    }
}

auto a = []() { using namespace NamespaceA::NamespaceB; };



The error is reported at 'using namespace' line:

error C2751: 'NamespaceA::NamespaceB' : the name of a function parameter cannot be qualified.


No error occurs if the 'a' variable is moved to a function.

Details
Sign in to post a comment.
Posted by Microsoft on 2/24/2011 at 12:46 PM
Hi:
    Thanks for reporting the issue.
    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 Microsoft on 1/18/2011 at 8:23 PM
Thanks for your feedback. We are routing 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 Microsoft on 1/18/2011 at 6:58 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.