instantiations if we encountered errors parsing some of the initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164578
91177308-0d34-0410-b5e6-
96231b3b80d8
NumInitializers * sizeof(CXXCtorInitializer*));
Constructor->setCtorInitializers(baseOrMemberInitializers);
}
-
+
+ // Let template instantiation know whether we had errors.
+ if (AnyErrors)
+ Constructor->setInvalidDecl();
+
return false;
}
const MultiLevelTemplateArgumentList &TemplateArgs) {
SmallVector<CXXCtorInitializer*, 4> NewInits;
- bool AnyErrors = false;
+ bool AnyErrors = Tmpl->isInvalidDecl();
// Instantiate all the initializers.
for (CXXConstructorDecl::init_const_iterator Inits = Tmpl->init_begin(),
return 0;
}
}
+
+namespace NonDependentError {
+ struct Base { Base(int); }; // expected-note 2{{candidate}}
+
+ template<typename T>
+ struct Derived1 : Base {
+ Derived1() : Base(1, 2) {} // expected-error {{no matching constructor}}
+ };
+
+ template<typename T>
+ struct Derived2 : Base {
+ Derived2() : BaseClass(1) {} // expected-error {{does not name a non-static data member or base}}
+ };
+
+ Derived1<void> d1;
+ Derived2<void> d2;
+}