diff options
-rw-r--r-- | clang/test/Parser/MicrosoftExtensions.cpp | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp index 351fa73588f..94047884d6b 100644 --- a/clang/test/Parser/MicrosoftExtensions.cpp +++ b/clang/test/Parser/MicrosoftExtensions.cpp @@ -297,28 +297,23 @@ int main () { missing_template_keyword<int>(); } +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; + } +} |