Search

Incorrect IDE error by _NN_

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 650667
Opened: 3/10/2011 9:16:11 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
This code compiles fine but I get error in static check:

namespace a
{
    class st
    {
        template<typename T> st& operator<<(T const& t) { return *this; }
    };

    int ff() { return 0; }
}

int main()
{
    a::st() << a::ff();
}



1    IntelliSense: function "a::st::operator<<(const T &t) [with T=int]" (declared at line 9) is inaccessible    c:\projects\test\exe\exe\exe.cpp    17    10    exe


There is no error here.
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010 SP1

What category (if any) best represents this feedback?

Reliability

Steps to reproduce

Copy paste the given code to the VS

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

Error in Error List

Expected results

No errors in Error List
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 3/11/2011 at 5:04 PM
Hello,

Thank you for reporting this bug. It is a bug in our batch compiler that we didn't give accessibility error on illegal call to private template operator. IntelliSense is right in diagosing. Good news is, we've fixed this bug in our compiler and you'll see the fix in our next major release. Thank you again for taking the time report this issue.

t.cpp(19) : error C2248: 'a::st::operator <<' : cannot access private member declared in class 'a::st'
        t.cpp(5) : see declaration of 'a::st::operator <<'
        t.cpp(4) : see declaration of 'a::st'


Thanks,
Ulzii Luvsanbat
Windows C++ Team
Posted by Microsoft on 3/10/2011 at 6:55 PM
Thank you for reporting the issue.
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 3/10/2011 at 10:14 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.