aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-12-15 16:32:14 +0000
committerDouglas Gregor <dgregor@apple.com>2008-12-15 16:32:14 +0000
commit7df7b6bb800e1987951285ea192e4f347e1b603a (patch)
tree6043f6cfb34b0d020970b2ca82ced64f3f5b6861 /lib/AST/Decl.cpp
parentf9d1e4bc60690386e0b2c658d707b75a77717a9c (diff)
Create new EnumDecl nodes for redeclarations of enums, linking them
together in the same way that we link RecordDecl/CXXRecordDecl nodes. Unify ActOnTag and ActOnTagStruct. Fixes PR clang/2753. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 7643e4eda8..4628761de5 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -113,9 +113,11 @@ TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC,
EnumDecl *EnumDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
IdentifierInfo *Id,
- ScopedDecl *PrevDecl) {
+ EnumDecl *PrevDecl) {
void *Mem = C.getAllocator().Allocate<EnumDecl>();
- return new (Mem) EnumDecl(DC, L, Id, PrevDecl);
+ EnumDecl *Enum = new (Mem) EnumDecl(DC, L, Id, 0);
+ C.getTypeDeclType(Enum, PrevDecl);
+ return Enum;
}
void EnumDecl::Destroy(ASTContext& C) {