diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h --- a/clang/include/clang/AST/DeclBase.h +++ b/clang/include/clang/AST/DeclBase.h @@ -1040,9 +1040,15 @@ /// Whether this declaration is a function or function template. bool isFunctionOrFunctionTemplate() const { - return (DeclKind >= Decl::firstFunction && - DeclKind <= Decl::lastFunction) || - DeclKind == FunctionTemplate; + switch (DeclKind) { + case Decl::Block: + case Decl::Captured: + case Decl::ObjCMethod: + case Decl::FunctionTemplate: + return true; + default: + return DeclKind >= Decl::firstFunction && DeclKind <= Decl::lastFunction; + } } /// If this is a declaration that describes some template, this