forked from OSchip/llvm-project
When searching for an instantiated declaration requires instantiation
of its parent context, be sure to update the parent-context pointer after instantiation. Fixes two anonymous-union instantiation issues in <rdar://problem/8635664>. llvm-svn: 118313
This commit is contained in:
parent
efabb123af
commit
25edf4302f
|
@ -2753,6 +2753,8 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D,
|
||||||
if (!Tag->isBeingDefined() &&
|
if (!Tag->isBeingDefined() &&
|
||||||
RequireCompleteType(Loc, T, diag::err_incomplete_type))
|
RequireCompleteType(Loc, T, diag::err_incomplete_type))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
ParentDC = Tag->getDecl();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,3 +17,24 @@ struct T1 : public T0, public T {
|
||||||
struct A : public T0 { };
|
struct A : public T0 { };
|
||||||
|
|
||||||
void f1(T1<A> *S) { S->f0(); } // expected-note{{instantiation of member function}}
|
void f1(T1<A> *S) { S->f0(); } // expected-note{{instantiation of member function}}
|
||||||
|
|
||||||
|
namespace rdar8635664 {
|
||||||
|
template<typename T>
|
||||||
|
struct X {
|
||||||
|
struct inner;
|
||||||
|
|
||||||
|
struct inner {
|
||||||
|
union {
|
||||||
|
int x;
|
||||||
|
float y;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
void test() {
|
||||||
|
X<int>::inner i;
|
||||||
|
i.x = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue