aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaExprCXX.cpp6
-rw-r--r--test/SemaTemplate/destructor-template.cpp7
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*);