[PATCH] D36918: [Sema] Take into account the current context when checking the accessibility of a member function pointer

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 6 18:37:34 PDT 2017


ahatanak added inline comments.


================
Comment at: lib/Sema/SemaAccess.cpp:1798
+  EffectiveContext EC(CurScope->getEntity());
+  if (IsAccessible(*this, EC, Entity) == ::AR_accessible)
+    return AR_accessible;
----------------
Rakete1111 wrote:
> You don't need that scope resolution operator there. Also, I guess you don't have to create `EC`, you can just pass `EffectiveContext(CurScope->getEntity())` directly to `IsAccessible`.
The scope resolution operator is needed here because IsAccessible's return type is AccessResult defined at the top of SemaAccess.cpp, not the one defined in Sema.h. If I remove the scope resolution operator, clang issues a warning ("comparison of two values with different enumeration types").

EffectiveContext is passed as a temporary now as you suggested.


https://reviews.llvm.org/D36918





More information about the cfe-commits mailing list