diff options
author | John McCall <rjmccall@apple.com> | 2011-10-01 05:17:03 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-10-01 05:17:03 +0000 |
commit | e82247a71a1a76e78f3b979b64d5f6412ab40266 (patch) | |
tree | dfe73fd7a7b7b163bee57b7bbadf0a54416dafdb /include/clang/Sema/AttributeList.h | |
parent | 130e5efd29a52a7cbd17c7b4a4744a320ee29692 (diff) |
Hey, maybe we shouldn't silently ignore decl attributes
on declarators written as types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140931 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/AttributeList.h')
-rw-r--r-- | include/clang/Sema/AttributeList.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/clang/Sema/AttributeList.h b/include/clang/Sema/AttributeList.h index c02d89dd11..46fcabc8e8 100644 --- a/include/clang/Sema/AttributeList.h +++ b/include/clang/Sema/AttributeList.h @@ -73,6 +73,9 @@ private: /// True if already diagnosed as invalid. mutable unsigned Invalid : 1; + /// True if this attribute was used as a type attribute. + mutable unsigned UsedAsTypeAttr : 1; + /// True if this has the extra information associated with an /// availability attribute. unsigned IsAvailability : 1; @@ -123,7 +126,8 @@ private: AttrRange(attrRange), ScopeLoc(scopeLoc), ParmLoc(parmLoc), NumArgs(numArgs), DeclspecAttribute(declspec), CXX0XAttribute(cxx0x), Invalid(false), - IsAvailability(false), NextInPosition(0), NextInPool(0) { + UsedAsTypeAttr(false), IsAvailability(false), + NextInPosition(0), NextInPool(0) { if (numArgs) memcpy(getArgsBuffer(), args, numArgs * sizeof(Expr*)); AttrKind = getKind(getName()); } @@ -139,8 +143,8 @@ private: : AttrName(attrName), ScopeName(scopeName), ParmName(parmName), AttrRange(attrRange), ScopeLoc(scopeLoc), ParmLoc(parmLoc), NumArgs(0), DeclspecAttribute(declspec), CXX0XAttribute(cxx0x), - Invalid(false), IsAvailability(true), UnavailableLoc(unavailable), - NextInPosition(0), NextInPool(0) { + Invalid(false), UsedAsTypeAttr(false), IsAvailability(true), + UnavailableLoc(unavailable), NextInPosition(0), NextInPool(0) { new (&getAvailabilitySlot(IntroducedSlot)) AvailabilityChange(introduced); new (&getAvailabilitySlot(DeprecatedSlot)) AvailabilityChange(deprecated); new (&getAvailabilitySlot(ObsoletedSlot)) AvailabilityChange(obsoleted); @@ -287,6 +291,9 @@ public: bool isInvalid() const { return Invalid; } void setInvalid(bool b = true) const { Invalid = b; } + bool isUsedAsTypeAttr() const { return UsedAsTypeAttr; } + void setUsedAsTypeAttr() { UsedAsTypeAttr = true; } + Kind getKind() const { return Kind(AttrKind); } static Kind getKind(const IdentifierInfo *Name); |