diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-20 19:58:21 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-20 19:58:21 +0000 |
commit | 31658dfe908d07666e2820ced8443a9a1988f1eb (patch) | |
tree | 4e636abd495c5de0861c084f0c900550ce355ee1 | |
parent | 699ee52b2f383b62865013c3575510b520055811 (diff) |
When checking the base object of a member access expression (b.foo,
b->foo), don't look through pointers unless we have an -> operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89480 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 6 | ||||
-rw-r--r-- | test/SemaTemplate/destructor-template.cpp | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 5962466023..be9375c495 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -2160,10 +2160,10 @@ Sema::ActOnStartCXXMemberReference(Scope *S, ExprArg Base, SourceLocation OpLoc, return ExprError(); } } - } - if (BaseType->isPointerType()) - BaseType = BaseType->getPointeeType(); + if (BaseType->isPointerType()) + BaseType = BaseType->getPointeeType(); + } // We could end up with various non-record types here, such as extended // vector types or Objective-C interfaces. Just return early and let diff --git a/test/SemaTemplate/destructor-template.cpp b/test/SemaTemplate/destructor-template.cpp index a7c8d247f0..afe2cfc300 100644 --- a/test/SemaTemplate/destructor-template.cpp +++ b/test/SemaTemplate/destructor-template.cpp @@ -9,4 +9,11 @@ template<typename A> class s0 { }; +struct Incomplete; +template<typename T> +void destroy_me(T me) { + me.~T(); +} + +template void destroy_me(Incomplete*); |