are invalid. Prevents a crash-on-invalid during template instantiation.
I... really don't understand how this wasn't already present.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101203
91177308-0d34-0410-b5e6-
96231b3b80d8
assert(Param->getDeclContext() != NewFD && "Was set before ?");
Param->setDeclContext(NewFD);
Params.push_back(Param);
+
+ if (Param->isInvalidDecl())
+ NewFD->setInvalidDecl();
}
}
template struct X3<double>;
+
+// Don't try to instantiate this, it's invalid.
+namespace test1 {
+ template <class T> class A {};
+ template <class T> class B {
+ void foo(A<test1::Undeclared> &a) // expected-error {{no member named 'Undeclared' in namespace 'test1'}}
+ {}
+ };
+ template class B<int>;
+}