of its parent context, be sure to update the parent-context pointer
after instantiation. Fixes two anonymous-union instantiation issues in
<rdar://problem/
8635664>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118313
91177308-0d34-0410-b5e6-
96231b3b80d8
if (!Tag->isBeingDefined() &&
RequireCompleteType(Loc, T, diag::err_incomplete_type))
return 0;
+
+ ParentDC = Tag->getDecl();
}
}
struct A : public T0 { };
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;
+ }
+}