https://llvm.org/bugs/show_bug.cgi?id=30601
Bug ID: 30601 Summary: Microsoft extensions allow to access private methods of template base class Product: clang Version: trunk Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: C++ Assignee: unassignedclangb...@nondot.org Reporter: agutow...@google.com CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Classification: Unclassified The following code shouldn't compile (method "f" is private). $ cat test.cpp #include <stdio.h> template<class T> class Base { void f() { printf("private Base::f()\n"); } }; template<class T> struct Container : Base<T> { void g() { f(); } }; int main() { Container<char> c; c.g(); return 0; } $ clang test.cpp -o test.exe test.cpp:10:14: warning: use of identifier 'f' found via unqualified lookup into dependent bases of class templates is a Microsoft extension [-Wmicrosoft-template] void g() { f(); } ^ this-> test.cpp:15:5: note: in instantiation of member function 'Container<char>::g' requested here c.g(); ^ test.cpp:5:8: note: must qualify identifier to find this declaration in dependent base class void f() { printf("private Base::f()\n"); } ^ 1 warning generated. $ test.exe private Base::f() -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs