expression. Fixes PR11339.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144159
91177308-0d34-0410-b5e6-
96231b3b80d8
if (!DestroyedTypeInfo)
return ExprError();
Destroyed = DestroyedTypeInfo;
- } else if (ObjectType->isDependentType()) {
+ } else if (!ObjectType.isNull() && ObjectType->isDependentType()) {
// We aren't likely to be able to resolve the identifier down to a type
// now anyway, so just retain the identifier.
Destroyed = PseudoDestructorTypeStorage(E->getDestroyedTypeIdentifier(),
x0.~X0();
}
+namespace PR11339 {
+ template<class T>
+ void destroy(T* p) {
+ p->~T(); // ok
+ p->~oops(); // expected-error{{expected the class name after '~' to name a destructor}}
+ }
+
+ template void destroy(int*); // expected-note{{in instantiation of function template specialization}}
+}