summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaAccess.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2012-04-18 03:24:38 +0000
committerFrancois Pichet <pichet2000@gmail.com>2012-04-18 03:24:38 +0000
commit5b061f015621f8b634a8fcb8a4ff26645941c1c9 (patch)
tree1380d2462f5a61a569d29c9723e6167e3e602392 /clang/lib/Sema/SemaAccess.cpp
parent01d61b0ae4f333fecf2dfeeef49fcb19f58bb438 (diff)
downloadbcm5719-llvm-5b061f015621f8b634a8fcb8a4ff26645941c1c9.tar.gz
bcm5719-llvm-5b061f015621f8b634a8fcb8a4ff26645941c1c9.zip
As per John McCall comment:
Follow up to r154924: check that we are in a static CMethodDecl to enable the Microsoft bug emulation regarding access to protected member during PTM creation. Not just any static function. llvm-svn: 154982
Diffstat (limited to 'clang/lib/Sema/SemaAccess.cpp')
-rw-r--r--clang/lib/Sema/SemaAccess.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaAccess.cpp b/clang/lib/Sema/SemaAccess.cpp
index 024838d4d4a..01c141e57f9 100644
--- a/clang/lib/Sema/SemaAccess.cpp
+++ b/clang/lib/Sema/SemaAccess.cpp
@@ -781,10 +781,10 @@ static AccessResult HasAccess(Sema &S,
// 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.
- if (S.getLangOpts().MicrosoftMode && !EC.Functions.empty() &&
- EC.Functions.front()->getStorageClass() == SC_Static)
- return AR_accessible;
+ // 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
OpenPOWER on IntegriCloud