diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-22 17:13:51 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-22 17:13:51 +0000 |
commit | 80f775359357f90f34b6adb8104506f13a816a67 (patch) | |
tree | 992c0b253dc6f3ebecdffafae11fc4de4e8fa032 | |
parent | cb8061e321bc6f46f154529885028256c7ae1fb2 (diff) |
objc- checking for objc decl context range is unreliable and
subject to change. Check for equality instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138238 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/DeclBase.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index dfe43f4086..b407701a7e 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -894,8 +894,15 @@ public: } bool isObjCContainer() const { - return (DeclKind >= (int)Decl::ObjCCategory && - DeclKind <= (int)Decl::ObjCProtocol); + switch (DeclKind) { + case Decl::ObjCCategory: + case Decl::ObjCCategoryImpl: + case Decl::ObjCImplementation: + case Decl::ObjCInterface: + case Decl::ObjCProtocol: + return true; + } + return false; } bool isFunctionOrMethod() const { |