This test courtesy of LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91462
91177308-0d34-0410-b5e6-
96231b3b80d8
CXXRecordDecl *PrevDecl = 0;
if (D->isInjectedClassName())
PrevDecl = cast<CXXRecordDecl>(Owner);
+ else if (D->getPreviousDeclaration()) {
+ NamedDecl *Prev = SemaRef.FindInstantiatedDecl(D->getPreviousDeclaration(),
+ TemplateArgs);
+ if (!Prev) return 0;
+ PrevDecl = cast<CXXRecordDecl>(Prev);
+ }
CXXRecordDecl *Record
= CXXRecordDecl::Create(SemaRef.Context, D->getTagKind(), Owner,
X<void>::C *c3; // okay
X<void>::D::E *e1; // okay
X<void>::D::E e2; // expected-note{{in instantiation of member class 'struct X<void>::D::E' requested here}}
+
+// Redeclarations.
+namespace test1 {
+ template <typename T> struct Registry {
+ class node;
+ static node *Head;
+ class node {
+ node(int v) { Head = this; }
+ };
+ };
+ void test() {
+ Registry<int>::node node(0);
+ }
+}