Hi,Visual C++ doesn't respect the access modifier (protected, or private) for operators that are member function templates.For example:class A{private: template<typename Y> void operator= (const Y y);};int _tmain(int argc, _TCHAR* argv[]){ A a; a = 0; return 0;}This code fails with the following linker error:error LNK2019: unresolved external symbol "private: void __thiscall A::operator=<int>(int)" (??$?4H@A@@AAEXH@Z) referenced in function _wmainInstead, it should fail with a compilation error:error C2248: 'A::operator =' : cannot access private member declared in class 'A'This bug can be reproduced in Visual C++ 2005, 2008, and 2010. As a comparison, gcc 4.4.5 is able to detect the error.IntelliSense in Visual C++ 2010 is able to detect the error:IntelliSense: "void A::operator=(Y y) [with Y=int]" (declared at line 11) is inaccessible
Visual Studio/Silverlight/Tooling version
What category (if any) best represents this feedback?
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results
Please wait...