From 9989ece040ea3431616f08d04528d6a02bdb2c74 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Fri, 16 Feb 2018 12:06:32 +0000 Subject: [PATCH] Revert r325321 "[Sema] Take into account the current context when checking the" This broke the Chromium build, see https://crbug.com/813017 > accessibility of a class member. > > This fixes PR32898. > > rdar://problem/33737747 > > Differential revision: https://reviews.llvm.org/D36918 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325335 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaAccess.cpp | 5 ----- test/SemaCXX/access.cpp | 35 ----------------------------------- 2 files changed, 40 deletions(-) diff --git a/lib/Sema/SemaAccess.cpp b/lib/Sema/SemaAccess.cpp index d2205dd239..98a918bd7d 100644 --- a/lib/Sema/SemaAccess.cpp +++ b/lib/Sema/SemaAccess.cpp @@ -1793,11 +1793,6 @@ Sema::AccessResult Sema::CheckAddressOfMemberAccess(Expr *OvlExpr, AccessTarget Entity(Context, AccessTarget::Member, NamingClass, Found, /*no instance context*/ QualType()); - - if (IsAccessible(*this, EffectiveContext(CurScope->getEntity()), Entity) == - ::AR_accessible) - return AR_accessible; - Entity.setDiag(diag::err_access) << Ovl->getSourceRange(); diff --git a/test/SemaCXX/access.cpp b/test/SemaCXX/access.cpp index 0707ec25be..29a58a1388 100644 --- a/test/SemaCXX/access.cpp +++ b/test/SemaCXX/access.cpp @@ -169,38 +169,3 @@ namespace ThisLambdaIsNotMyFriend { } void bar() { foo(); } } - -namespace OverloadedMemberFunctionPointer { - template - void func0() {} - - template - void func1() {} - - template - void func2(void(*fn)()) {} // expected-note 2 {{candidate function not viable: no overload of 'func}} - - class C { - private: - friend void friendFunc(); - void overloadedMethod(); - protected: - void overloadedMethod(int); - public: - void overloadedMethod(int, int); - void method() { - func2(&func0); - func2(&func1); - } - }; - - void friendFunc() { - func2(&func0); - func2(&func1); - } - - void nonFriendFunc() { - func2(&func0); // expected-error {{no matching function for call to 'func2'}} - func2(&func1); // expected-error {{no matching function for call to 'func2'}} - } -} -- 2.40.0