diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-04-15 05:49:29 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-04-15 05:49:29 +0000 |
commit | 831efaeb4ba2c0939db6eeb77229d9e47dd03c9c (patch) | |
tree | 87ea5c11e7c9febf9e51ae8c043d9b455e7cd4ef /include/clang/Sema/AttributeList.h | |
parent | fc8f0e14ad142ed811e90fbd9a30e419e301c717 (diff) |
Improve diagnostics on GNU attributes by warning about attributes that should have no arguments or parameters. Patch by Michael Han!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129560 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/AttributeList.h')
-rw-r--r-- | include/clang/Sema/AttributeList.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/clang/Sema/AttributeList.h b/include/clang/Sema/AttributeList.h index ed2295554e..e976865217 100644 --- a/include/clang/Sema/AttributeList.h +++ b/include/clang/Sema/AttributeList.h @@ -264,6 +264,10 @@ public: /// getNumArgs - Return the number of actual arguments to this attribute. unsigned getNumArgs() const { return NumArgs; } + /// hasParameterOrArguments - Return true if this attribute has a parameter, + /// or has a non empty argument expression list. + bool hasParameterOrArguments() const { return ParmName || NumArgs; } + /// getArg - Return the specified argument. Expr *getArg(unsigned Arg) const { assert(Arg < NumArgs && "Arg access out of range!"); |