diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-09-24 10:38:05 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-09-24 10:38:05 +0000 |
commit | fce1a3ab56879a7eb92c7e0b465c1f2c07e0c512 (patch) | |
tree | 38c8da9c5fc046fe5ace22c5420aa3eeee147872 /lib/Sema/SemaExpr.cpp | |
parent | d25be9f401baf469892890119f915289b041e4f0 (diff) |
[microsoft] In Microsoft mode, if we are inside a template class member function and we can't resolve an identifier then assume the identifier is type dependent. The goal is to postpone name lookup to instantiation time to be able to search into type dependent base classes.
This fixes a few errors when parsing MFC code with clang.
BTW clang trunk is now about 5 patches away to be able the parse the default wizard-generated MFC project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 31eb19e174..c06f5a7b83 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1690,6 +1690,16 @@ ExprResult Sema::ActOnIdExpression(Scope *S, // If this name wasn't predeclared and if this is not a function // call, diagnose the problem. if (R.empty()) { + + // In Microsoft mode, if we are inside a template class member function + // and we can't resolve an identifier then assume the identifier is type + // dependent. The goal is to postpone name lookup to instantiation time + // to be able to search into type dependent base classes. + if (getLangOptions().MicrosoftMode && CurContext->isDependentContext() && + isa<CXXMethodDecl>(CurContext)) + return ActOnDependentIdExpression(SS, NameInfo, IsAddressOfOperand, + TemplateArgs); + if (DiagnoseEmptyLookup(S, SS, R, CTC_Unknown)) return ExprError(); |