Make the injected-class-name of a C++ class a separate RecordDecl from the class itself, with a different scope. This eliminates some ownership issues, so that the RecordDecl only lives in a single context

llvm-svn: 61140
This commit is contained in:
Douglas Gregor 2008-12-17 16:48:01 +00:00
parent 816dba163e
commit 664fda14d3
1 changed files with 3 additions and 1 deletions

View File

@ -408,7 +408,9 @@ void Sema::ActOnStartCXXClassDef(Scope *S, DeclTy *D, SourceLocation LBrace) {
// class itself; this is known as the injected-class-name. For
// purposes of access checking, the injected-class-name is treated
// as if it were a public member name.
PushOnScopeChains(Dcl, S);
PushOnScopeChains(CXXRecordDecl::Create(Context, Dcl->getTagKind(),
CurContext, Dcl->getLocation(),
Dcl->getIdentifier(), Dcl), S);
}
}