summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-04 22:49:18 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-04 22:49:18 +0000
commit41127188ac7c977854066eac61f1b075269082b8 (patch)
tree6ce8c95b24d2000100f7e5c89233dacde6212d3a /clang/lib/Sema/SemaExprCXX.cpp
parentb689d0c95e3970c8851ef648d8b96be90b841276 (diff)
downloadbcm5719-llvm-41127188ac7c977854066eac61f1b075269082b8.tar.gz
bcm5719-llvm-41127188ac7c977854066eac61f1b075269082b8.zip
When starting a C++ member access expression, make sure to compute the
type of the object even when it is dependent. Specifically, this makes sure that we get the right type for "this->", which is important when performing name lookup into this scope to determine whether an identifier or operator-function-id is a template name. llvm-svn: 86060
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 4868c14835f..6fdecc26752 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -2030,7 +2030,13 @@ Sema::ActOnStartCXXMemberReference(Scope *S, ExprArg Base, SourceLocation OpLoc,
QualType BaseType = BaseExpr->getType();
if (BaseType->isDependentType()) {
- // FIXME: member of the current instantiation
+ // If we have a pointer to a dependent type and are using the -> operator,
+ // the object type is the type that the pointer points to. We might still
+ // have enough information about that type to do something useful.
+ if (OpKind == tok::arrow)
+ if (const PointerType *Ptr = BaseType->getAs<PointerType>())
+ BaseType = Ptr->getPointeeType();
+
ObjectType = BaseType.getAsOpaquePtr();
return move(Base);
}
OpenPOWER on IntegriCloud