Don't prematurely clean up an RAII object; there's another RAII object in the
same scope that tries to save and restore the same member!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291551
91177308-0d34-0410-b5e6-
96231b3b80d8
if (auto *L = getASTMutationListener())
L->DefaultMemberInitializerInstantiated(Instantiation);
- // Exit the scope of this instantiation.
- SavedContext.pop();
-
// Return true if the in-class initializer is still missing.
return !Instantiation->getInClassInitializer();
}
int y = x;
};
}
+
+// Instantiating another default member initializer while parsing one should
+// not cause us to mess up the 'this' override.
+template<typename> struct DefaultMemberTemplate { int n = 0; };
+class DefaultMemberInitSelf {
+ DefaultMemberTemplate<int> t = {};
+ int *p = &t.n;
+};