Fixes PR16292.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184581
91177308-0d34-0410-b5e6-
96231b3b80d8
Base = Pattern->bases_begin(), BaseEnd = Pattern->bases_end();
Base != BaseEnd; ++Base) {
if (!Base->getType()->isDependentType()) {
+ if (const CXXRecordDecl *RD = Base->getType()->getAsCXXRecordDecl()) {
+ if (RD->isInvalidDecl())
+ Instantiation->setInvalidDecl();
+ }
InstantiatedBases.push_back(new (Context) CXXBaseSpecifier(*Base));
continue;
}
}
};
}
+
+namespace PR16292 {
+ class IncompleteClass; // expected-note{{forward declaration}}
+ class BaseClass {
+ IncompleteClass Foo; // expected-error{{field has incomplete type}}
+ };
+ template<class T> class DerivedClass : public BaseClass {};
+ void* p = new DerivedClass<void>;
+}