diff options
| author | Douglas Gregor <dgregor@apple.com> | 2008-11-10 14:41:22 +0000 | 
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2008-11-10 14:41:22 +0000 | 
| commit | 1cd48f1645067f31efe3fdf9644a8106c19f7427 (patch) | |
| tree | 808f8c66435c90d7a583ef9fa436c800540a8d48 /clang/lib/Sema/SemaDeclCXX.cpp | |
| parent | 6cf0806e75fba6857c1c5df97f9881bf45e1ab42 (diff) | |
| download | bcm5719-llvm-1cd48f1645067f31efe3fdf9644a8106c19f7427.tar.gz bcm5719-llvm-1cd48f1645067f31efe3fdf9644a8106c19f7427.zip | |
Don't create a typedef for the injected-class-name
llvm-svn: 58987
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 19 | 
1 files changed, 5 insertions, 14 deletions
| diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index c10fd8b3c26..dd00998d410 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -400,11 +400,7 @@ 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. -    // FIXME: this should probably have its own kind of type node. -    TypedefDecl *InjectedClassName  -      = TypedefDecl::Create(Context, Dcl, LBrace, Dcl->getIdentifier(), -                            Context.getTypeDeclType(Dcl), /*PrevDecl=*/0); -    PushOnScopeChains(InjectedClassName, S); +    PushOnScopeChains(Dcl, S);    }  } @@ -924,15 +920,10 @@ bool Sema::CheckDestructorDeclarator(Declarator &D, QualType &R,    //   declaration.    TypeDecl *DeclaratorTypeD = (TypeDecl *)D.getDeclaratorIdType();    if (const TypedefDecl *TypedefD = dyn_cast<TypedefDecl>(DeclaratorTypeD)) { -    if (TypedefD->getIdentifier() !=  -          cast<CXXRecordDecl>(CurContext)->getIdentifier()) { -      // FIXME: This would be easier if we could just look at whether -      // we found the injected-class-name. -      Diag(D.getIdentifierLoc(),  -           diag::err_destructor_typedef_name, -           TypedefD->getName()); -      isInvalid = true; -    } +    Diag(D.getIdentifierLoc(),  +         diag::err_destructor_typedef_name, +         TypedefD->getName()); +    isInvalid = true;    }    // C++ [class.dtor]p2: | 

