diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp index 351fa73588f3..94047884d6be 100644 --- a/clang/test/Parser/MicrosoftExtensions.cpp +++ b/clang/test/Parser/MicrosoftExtensions.cpp @@ -297,28 +297,23 @@ int main () { missing_template_keyword(); } +namespace access_protected_PTM { + class A { + protected: + void f(); // expected-note {{must name member using the type of the current context 'access_protected_PTM::B'}} + }; + class B : public A{ + public: + void test_access(); + static void test_access_static(); + }; - -namespace access_protected_PTM { - -class A { -protected: - void f(); // expected-note {{must name member using the type of the current context 'access_protected_PTM::B'}} -}; - -class B : public A{ -public: - void test_access(); - static void test_access_static(); -}; - -void B::test_access() { - &A::f; // expected-error {{'f' is a protected member of 'access_protected_PTM::A'}} -} - -void B::test_access_static() { - &A::f; -} - -} \ No newline at end of file + void B::test_access() { + &A::f; // expected-error {{'f' is a protected member of 'access_protected_PTM::A'}} + } + + void B::test_access_static() { + &A::f; + } +}