aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-22 16:25:05 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-22 16:25:05 +0000
commitd9008318fe395dcbb9049cfb4f2b87cfb5a75f3a (patch)
tree24efb289f4572143795a80dee82e408447d7733b /lib/Sema/Sema.cpp
parent0fddb97901dbe36a8253dee29961cba8e0a87cf6 (diff)
When determining whether we can use "this", make sure to look through
enum contexts (along with block contexts, which we already did). Fixes PR7196. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 5e365de695..523b196392 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -305,7 +305,7 @@ void Sema::ActOnEndOfTranslationUnit() {
DeclContext *Sema::getFunctionLevelDeclContext() {
DeclContext *DC = CurContext;
- while (isa<BlockDecl>(DC))
+ while (isa<BlockDecl>(DC) || isa<EnumDecl>(DC))
DC = DC->getParent();
return DC;