Diagnose UnresolvedLookupExprs that resolve to instance members in static methods
During the initial template parse for this code, 'member' is unresolved and we don't know anything about it: struct A { int member }; template <typename T> struct B : public T { using T::member; static void f() { (void)member; // Could be static or non-static. } }; template class B<A>; The pattern declaration contains an UnresolvedLookupExpr rather than an UnresolvedMemberExpr because `f` is static, and `member` should never be a field. However, if the code is invalid, it may become a field, in which case we should diagnose it. Reviewers: rjmccall, rsmith Differential Revision: http://reviews.llvm.org/D6700 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250592 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Sema/Sema.h 3 additions, 0 deletionsinclude/clang/Sema/Sema.h
- lib/Sema/SemaExprMember.cpp 11 additions, 14 deletionslib/Sema/SemaExprMember.cpp
- lib/Sema/TreeTransform.h 11 additions, 1 deletionlib/Sema/TreeTransform.h
- test/SemaCXX/using-decl-1.cpp 50 additions, 1 deletiontest/SemaCXX/using-decl-1.cpp
Loading
Please register or sign in to comment