[PATCH] D6700: Instantiate UnresolvedLookupExpr to MemberExpr when appropriate

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 13 13:08:12 PDT 2015


rnk added a comment.

Richard suggested that maybe we formed the wrong AST while parsing the template. I'm not sure that's the case. We have this very explicit logic that controls what AST nodes we form in SemaExprMember.cpp ClassifyImplicitMemberAccess:

  bool isStaticContext = SemaRef.CXXThisTypeOverride.isNull() &&
    (!isa<CXXMethodDecl>(DC) || cast<CXXMethodDecl>(DC)->isStatic());
  if (R.isUnresolvableResult())
    return isStaticContext ? IMA_Unresolved_StaticContext : IMA_Unresolved;

John wrote this code in r90266. The behavior seems pretty intentional, so think we're forming the right AST for the template. Our AST just anticipates that it's going to be instantiated with a base class where the member in question is static.

I think we just need some extra diagnostics during instantiation, which this change implements as-is. What do you think? I'll reupload without the other changes.


http://reviews.llvm.org/D6700





More information about the cfe-commits mailing list