From: Douglas Gregor Date: Fri, 20 Nov 2009 19:58:21 +0000 (+0000) Subject: When checking the base object of a member access expression (b.foo, X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31658dfe908d07666e2820ced8443a9a1988f1eb;p=clang 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 --- 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 class s0 { }; +struct Incomplete; +template +void destroy_me(T me) { + me.~T(); +} + +template void destroy_me(Incomplete*);