summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-09-24 10:38:05 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-09-24 10:38:05 +0000
commitd8e4e41301178c3276728dd77e3140efd12c3bfa (patch)
tree476cca4f2c66193a78bf1333d86bce6ad7a00bb2 /clang/lib/Sema/SemaExpr.cpp
parentd9dc52dc4c081baac2d611f978b9c01f72a625fe (diff)
downloadbcm5719-llvm-d8e4e41301178c3276728dd77e3140efd12c3bfa.tar.gz
bcm5719-llvm-d8e4e41301178c3276728dd77e3140efd12c3bfa.zip
[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. llvm-svn: 140452
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 31eb19e1747..c06f5a7b83b 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud