Fixes PR21221. Patch by Axel Naumann, test by me.
llvm-svn: 221771
if (TypeDecl *Type = Found.getAsSingle<TypeDecl>()) {
QualType T = Context.getTypeDeclType(Type);
+ MarkAnyDeclReferenced(Type->getLocation(), Type, /*OdrUse=*/false);
if (SearchType.isNull() || SearchType->isDependentType() ||
Context.hasSameUnqualifiedType(T, SearchType)) {
};
}
+void *operator new(__SIZE_TYPE__, void *p) throw() { return p; }
+void placement_new_and_delete() {
+ struct MyStruct { };
+ char memory[sizeof(MyStruct)];
+ void *p = memory;
+
+ typedef MyStruct A_t1;
+ MyStruct *a = new (p) A_t1();
+
+ typedef MyStruct A_t2;
+ a->~A_t2();
+}
+
// This should not disable any warnings:
#pragma clang diagnostic ignored "-Wunused-local-typedef"