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
diff --git a/test/SemaCXX/MicrosoftExtensions.cpp b/test/SemaCXX/MicrosoftExtensions.cpp
index 88e3922..3391e7a 100644
--- a/test/SemaCXX/MicrosoftExtensions.cpp
+++ b/test/SemaCXX/MicrosoftExtensions.cpp
@@ -197,3 +197,22 @@
    ch = (char)ptr;
    sh = (short)ptr;
 } 
+
+namespace ms_using_declaration_bug {
+
+class A {
+public: 
+  int f(); 
+};
+
+class B : public A {
+private:   
+  using A::f;
+};
+
+class C : public B { 
+private:   
+  using B::f; // expected-warning {{using declaration refers to inaccessible member 'ms_using_declaration_bug::B::f', which refers to accessible member 'ms_using_declaration_bug::A::f', accepted for Microsoft compatibility}}
+};
+
+}
\ No newline at end of file