summaryrefslogtreecommitdiffstats
path: root/clang/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
commit0c6f5395644a3cb838b63e48a1df00f4648cbf20 (patch)
treef41bca0b36cd6c9a5f42e5c3779e82df161f8270 /clang/lib/Sema/Sema.cpp
parent959d5a0cbd78f8e658a8ec203e675ddb164ee879 (diff)
downloadbcm5719-llvm-0c6f5395644a3cb838b63e48a1df00f4648cbf20.tar.gz
bcm5719-llvm-0c6f5395644a3cb838b63e48a1df00f4648cbf20.zip
When determining whether we can use "this", make sure to look through
enum contexts (along with block contexts, which we already did). Fixes PR7196. llvm-svn: 104444
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r--clang/lib/Sema/Sema.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 5e365de6950..523b1963922 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud