Эх сурвалжийг харах

Move Microsoft access specifier bug emulation from -fms-extensions to -fm-compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140189 91177308-0d34-0410-b5e6-96231b3b80d8
Francois Pichet 14 жил өмнө
parent
commit
cc6306e967

+ 1 - 1
lib/Sema/SemaAccess.cpp

@@ -1270,7 +1270,7 @@ static AccessResult CheckEffectiveAccess(Sema &S,
                                          AccessTarget &Entity) {
                                          AccessTarget &Entity) {
   assert(Entity.getAccess() != AS_public && "called for public access!");
   assert(Entity.getAccess() != AS_public && "called for public access!");
 
 
-  if (S.getLangOptions().MicrosoftExt &&
+  if (S.getLangOptions().MicrosoftMode &&
       IsMicrosoftUsingDeclarationAccessBug(S, Loc, Entity))
       IsMicrosoftUsingDeclarationAccessBug(S, Loc, Entity))
     return AR_accessible;
     return AR_accessible;
 
 

+ 20 - 0
test/SemaCXX/MicrosoftCompatibility.cpp

@@ -70,3 +70,23 @@ int jump_over_indirect_goto() {
 
 
 
 
 
 
+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}}
+};
+
+}
+
+

+ 0 - 20
test/SemaCXX/MicrosoftExtensions.cpp

@@ -213,26 +213,6 @@ void pointer_to_integral_type_conv(char* ptr) {
    sh = (short)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 {
 namespace friend_as_a_forward_decl {