From: Douglas Gregor Date: Wed, 17 Dec 2008 16:48:01 +0000 (+0000) Subject: Make the injected-class-name of a C++ class a separate RecordDecl from the class... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=510ffaefd48b0784367693e823768ac49e288781;p=clang 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61140 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 29605b6485..7be76bba1a 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -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); } }