]> granicus.if.org Git - clang/commit
Teach DeclContext how to find the primary declaration for any TagDecl
authorDouglas Gregor <dgregor@apple.com>
Sat, 17 Jan 2009 00:42:38 +0000 (00:42 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sat, 17 Jan 2009 00:42:38 +0000 (00:42 +0000)
commit0b7a158d120ac8d78c114a823e17eedfec6b6658
tree06cb618c16a5c1e606f20e137a6be209ddb8bbe1
parent41f2b32df5faff10c305ef1892fcb02846e4f489
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62386 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/clang/AST/ASTContext.h
include/clang/AST/Decl.h
include/clang/AST/Type.h
include/clang/Basic/SourceLocation.h
include/clang/Parse/Action.h
lib/AST/ASTContext.cpp
lib/AST/Decl.cpp
lib/AST/DeclBase.cpp
lib/AST/TypeSerialization.cpp
lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaLookup.cpp
test/Sema/enum.c
test/SemaCXX/qualified-id-lookup.cpp