From dee1be8e959e63c99cf87258f72beda0e5ae3c1d Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sat, 17 Jan 2009 00:42:38 +0000 Subject: Teach DeclContext how to find the primary declaration for any TagDecl even when we are still defining the TagDecl. This is required so that qualified name lookup of a class name within its definition works (see the new bits in test/SemaCXX/qualified-id-lookup.cpp). As part of this, move the nested redefinition checking code into ActOnTag. This gives us diagnostics earlier (when we try to perform the nested redefinition, rather than when we try to complete the 2nd definition) and removes some code duplication. llvm-svn: 62386 --- clang/lib/AST/ASTContext.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'clang/lib/AST/ASTContext.cpp') diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 8e7410c47c7..7cb035b8680 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1076,11 +1076,6 @@ QualType ASTContext::getTypeDeclType(TypeDecl *Decl, TypeDecl* PrevDecl) { return QualType(Decl->TypeForDecl, 0); } -void ASTContext::setTagDefinition(TagDecl* D) { - assert (D->isDefinition()); - cast(D->TypeForDecl)->decl = D; -} - /// getTypedefType - Return the unique reference to the type for the /// specified typename decl. QualType ASTContext::getTypedefType(TypedefDecl *Decl) { -- cgit v1.2.3