]> granicus.if.org Git - clang/commitdiff
Move Microsoft access specifier bug emulation from -fms-extensions to -fm-compatibility.
authorFrancois Pichet <pichet2000@gmail.com>
Tue, 20 Sep 2011 22:08:26 +0000 (22:08 +0000)
committerFrancois Pichet <pichet2000@gmail.com>
Tue, 20 Sep 2011 22:08:26 +0000 (22:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140189 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaAccess.cpp
test/SemaCXX/MicrosoftCompatibility.cpp
test/SemaCXX/MicrosoftExtensions.cpp

index db78680a13ac826054a470f28541d2971fcb030d..e501a393d1be3252c715fe2950034b378590b9e4 100644 (file)
@@ -1270,7 +1270,7 @@ static AccessResult CheckEffectiveAccess(Sema &S,
                                          AccessTarget &Entity) {
   assert(Entity.getAccess() != AS_public && "called for public access!");
 
-  if (S.getLangOptions().MicrosoftExt &&
+  if (S.getLangOptions().MicrosoftMode &&
       IsMicrosoftUsingDeclarationAccessBug(S, Loc, Entity))
     return AR_accessible;
 
index 98a7532f0c5579d217b3a376d7000b1a4e8f8897..4179ed81f3ee7f66dd0b7a6963625f78e4ff6641 100644 (file)
@@ -70,3 +70,23 @@ int jump_over_indirect_goto() {
 
 
 
+namespace ms_using_declaration_bug {\r
+\r
+class A {\r
+public: \r
+  int f(); \r
+};\r
+\r
+class B : public A {\r
+private:   \r
+  using A::f;\r
+};\r
+\r
+class C : public B { \r
+private:   \r
+  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}}\r
+};\r
+\r
+}\r
+\r
+\r
index e5e5752dba85750ffe68f41c030a395caa6e61e6..1eb0c495f82a1cdbb6d8fa2977b115e1c505ace3 100644 (file)
@@ -213,26 +213,6 @@ void pointer_to_integral_type_conv(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}}
-};
-
-}
-
-
 
 namespace friend_as_a_forward_decl {