diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-05-03 16:53:59 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-05-03 16:53:59 +0000 |
commit | 6b9a6e390fbb92c40eb9c6ac9e7abbd88dd7a767 (patch) | |
tree | 2e51705e103e92c7be1b21e8bd8ffd5b5d0e4d52 /lib/Sema/SemaAccess.cpp | |
parent | dbe13110f59f48b4dbb7552b3ac2935acdeece7f (diff) |
Notes
Diffstat (limited to 'lib/Sema/SemaAccess.cpp')
-rw-r--r-- | lib/Sema/SemaAccess.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaAccess.cpp b/lib/Sema/SemaAccess.cpp index dea5e76d9e13..01c141e57f92 100644 --- a/lib/Sema/SemaAccess.cpp +++ b/lib/Sema/SemaAccess.cpp @@ -779,6 +779,13 @@ static AccessResult HasAccess(Sema &S, // that the naming class has to be derived from the effective // context. + // Emulate a MSVC bug where the creation of pointer-to-member + // to protected member of base class is allowed but only from + // a static function member functions. + if (S.getLangOpts().MicrosoftMode && !EC.Functions.empty()) + if (CXXMethodDecl* MD = dyn_cast<CXXMethodDecl>(EC.Functions.front())) + if (MD->isStatic()) return AR_accessible; + // Despite the standard's confident wording, there is a case // where you can have an instance member that's neither in a // pointer-to-member expression nor in a member access: when |