mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Deprecate attr_tag in a different way, rename to AttrTag
This commit is contained in:
parent
a5a51de3c4
commit
a280bfa0b1
9 changed files with 67 additions and 137 deletions
20
src/Type.h
20
src/Type.h
|
@ -638,14 +638,7 @@ public:
|
|||
TypeDecl(const TypeDecl& other);
|
||||
~TypeDecl();
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
[[deprecated("Remove in v4.1. Use GetAttr().")]]
|
||||
const zeek::detail::Attr* FindAttr(::attr_tag a) const
|
||||
{ return attrs ? attrs->Find(static_cast<zeek::detail::attr_tag>(a)).get() : nullptr; }
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
const IntrusivePtr<zeek::detail::Attr>& GetAttr(zeek::detail::attr_tag a) const
|
||||
const IntrusivePtr<zeek::detail::Attr>& GetAttr(zeek::detail::AttrTag a) const
|
||||
{ return attrs ? attrs->Find(a) : zeek::detail::Attr::nil; }
|
||||
|
||||
void DescribeReST(ODesc* d, bool roles_only = false) const;
|
||||
|
@ -746,21 +739,12 @@ public:
|
|||
return decl && decl->GetAttr(zeek::detail::ATTR_DEPRECATED) != nullptr;
|
||||
}
|
||||
|
||||
bool FieldHasAttr(int field, zeek::detail::attr_tag at) const
|
||||
bool FieldHasAttr(int field, zeek::detail::AttrTag at) const
|
||||
{
|
||||
const TypeDecl* decl = FieldDecl(field);
|
||||
return decl && decl->GetAttr(at) != nullptr;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
[[deprecated("Remove in v4.1. Use version that takes zeek::detail::attr_tag.")]]
|
||||
bool FieldHasAttr(int field, ::attr_tag at) const
|
||||
{
|
||||
return FieldHasAttr(field, static_cast<zeek::detail::attr_tag>(at));
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
std::string GetFieldDeprecationWarning(int field, bool has_check) const;
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue