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

llvm-svn: 140189
This commit is contained in:
Francois Pichet 2011-09-20 22:08:26 +00:00
parent 49621cb209
commit b3642c2c7a
3 changed files with 21 additions and 21 deletions

View 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;

View File

@ -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}}
};
}

View 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 {