]> granicus.if.org Git - clang/commit
Emulate a MSVC bug where if during an using declaration name lookup, the declaration...
authorFrancois Pichet <pichet2000@gmail.com>
Mon, 23 May 2011 03:43:44 +0000 (03:43 +0000)
committerFrancois Pichet <pichet2000@gmail.com>
Mon, 23 May 2011 03:43:44 +0000 (03:43 +0000)
commitb2ee8305f878259613b65d0f96a03f7f852977ea
treea58c35169e305e6e8c56296a2bb18525d99eeeb9
parentf6f7f57c34164038e860713ee8d2f4ebd01cd9e4
Emulate a MSVC bug where if during an using declaration name lookup, the declaration found is unaccessible (private) and that declaration was bring into scope via another using declaration whose target declaration is accessible (public) then no error is generated.

Example:
class A { public: int f();  };
class B : public A { private: using A::f; };
class C : public B { private: using B::f; };

Here, B::f is private so this should fail in Standard C++, but because B::f refers to A::f which is public MSVC accepts it.

This fixes 1 error when parsing MFC code with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131896 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Lookup.h
lib/Sema/SemaAccess.cpp
lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/MicrosoftExtensions.cpp