[cfe-commits] r58987 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Douglas Gregor doug.gregor at gmail.com
Mon Nov 10 06:41:27 PST 2008


Author: dgregor
Date: Mon Nov 10 08:41:22 2008
New Revision: 58987

URL: http://llvm.org/viewvc/llvm-project?rev=58987&view=rev
Log:
Don't create a typedef for the injected-class-name

Modified:
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=58987&r1=58986&r2=58987&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon Nov 10 08:41:22 2008
@@ -400,11 +400,7 @@
     //   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 @@
   //   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:





More information about the cfe-commits mailing list