Incorrect IDE error - by _NN_

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.


1
0
Sign in
to vote
ID 650667 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 3/10/2011 9:16:11 AM
Access Restriction Public

Description

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.
Sign in to post a comment.
Posted by Ulzii [MSFT] 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)