forked from OSchip/llvm-project
Move Microsoft access specifier bug emulation from -fms-extensions to -fm-compatibility.
llvm-svn: 140189
This commit is contained in:
parent
49621cb209
commit
b3642c2c7a
|
@ -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;
|
||||
|
||||
|
|
|
@ -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}}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Reference in New Issue