aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-11-10 14:41:22 +0000
committerDouglas Gregor <dgregor@apple.com>2008-11-10 14:41:22 +0000
commit55c60954c273c225777276cbd9db477939c6f073 (patch)
treea84d236226ad877a3f7eef43fb3f081df0cba782
parent02bcd4cd1a19121da12884aa4943226f72a81e6c (diff)
Don't create a typedef for the injected-class-name
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58987 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDeclCXX.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index c10fd8b3c2..dd00998d41 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/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: