aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-12-17 02:04:30 +0000
committerDouglas Gregor <dgregor@apple.com>2008-12-17 02:04:30 +0000
commit45579f5e2904590ff9a4f48c7fbf2e60dccb0426 (patch)
tree38d84a1dd456d9c7fdd1cc30747118cd74da53ff /lib/Sema/SemaDecl.cpp
parente79837aacddb4713465006c0b030bc0675339573 (diff)
Make sure that enumerators show up within the enumeration declaration. Fixes. PR clang/3220
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index b7c83162d6..177bf1a659 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3185,6 +3185,12 @@ Sema::DeclTy *Sema::ActOnEnumConstant(Scope *S, DeclTy *theEnumDecl,
// Register this decl in the current scope stack.
PushOnScopeChains(New, S);
+
+ // Add this enumerator into the enum itself.
+ // FIXME: This means that the enumerator is stored in two
+ // DeclContexts. This is not a long-term solution.
+ New->setLexicalDeclContext(TheEnumDecl);
+ TheEnumDecl->addDecl(Context, New, true);
return New;
}