From: Chris Lattner Date: Sun, 12 Apr 2009 20:07:59 +0000 (+0000) Subject: add a new Decl::hasAttr() predicate. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=115cafcafec3572756635ca81ef83999ae0c8af7;p=clang add a new Decl::hasAttr() predicate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68907 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index d05b5a597e..7f427e3eb3 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -223,6 +223,10 @@ public: return 0; } + template bool hasAttr() const { + return getAttr() != 0; + } + /// setInvalidDecl - Indicates the Decl had a semantic error. This /// allows for graceful error recovery. void setInvalidDecl(bool Invalid = true) { InvalidDecl = Invalid; }