diff options
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 8 | 
1 files changed, 5 insertions, 3 deletions
| diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 91ef67e1c9a..3242f70f128 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -330,11 +330,13 @@ Sema::ActOnDependentIdExpression(const CXXScopeSpec &SS,                             const TemplateArgumentListInfo *TemplateArgs) {    NestedNameSpecifier *Qualifier      = static_cast<NestedNameSpecifier*>(SS.getScopeRep()); + +  DeclContext *DC = getFunctionLevelDeclContext();    if (!isAddressOfOperand && -      isa<CXXMethodDecl>(CurContext) && -      cast<CXXMethodDecl>(CurContext)->isInstance()) { -    QualType ThisType = cast<CXXMethodDecl>(CurContext)->getThisType(Context); +      isa<CXXMethodDecl>(DC) && +      cast<CXXMethodDecl>(DC)->isInstance()) { +    QualType ThisType = cast<CXXMethodDecl>(DC)->getThisType(Context);      // Since the 'this' expression is synthesized, we don't need to      // perform the double-lookup check. | 

