Add deprecation expression to deprecated prototype/parameter messages

This commit is contained in:
Jon Siwek 2020-07-09 21:25:35 -07:00
parent ac1ec7668d
commit 8597b998bb
7 changed files with 58 additions and 25 deletions

View file

@ -294,14 +294,7 @@ std::string ID::GetDeprecationWarning() const
const auto& depr_attr = GetAttr(ATTR_DEPRECATED);
if ( depr_attr )
{
auto expr = static_cast<zeek::detail::ConstExpr*>(depr_attr->GetExpr().get());
if ( expr )
{
StringVal* text = expr->Value()->AsStringVal();
result = text->CheckString();
}
}
result = depr_attr->DeprecationMessage();
if ( result.empty() )
return fmt("deprecated (%s)", Name());