mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Stmt: Error on deprecated when/local usage
This has been around since Zeek v4.1, so it was warned about in Zeek 5.0 LTS and we could've removed it with 5.1. Also removed merge_top_scope() from the zeek::detail namespace, it's unused now. Updated the when-aggregates test somehow. I'm not quite sure what had been tested there :-/
This commit is contained in:
parent
5ef62b2de8
commit
bb80d80218
9 changed files with 18 additions and 36 deletions
|
@ -1933,11 +1933,10 @@ WhenInfo::WhenInfo(bool arg_is_return) : is_return(arg_is_return)
|
|||
|
||||
void WhenInfo::Build(StmtPtr ws)
|
||||
{
|
||||
// This will call ws->Error() if it's deprecated and we can
|
||||
// short-circuit.
|
||||
if ( IsDeprecatedSemantics(ws) )
|
||||
{
|
||||
merge_top_scope();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! cl )
|
||||
{
|
||||
|
@ -2095,9 +2094,9 @@ bool WhenInfo::IsDeprecatedSemantics(StmtPtr ws)
|
|||
}
|
||||
|
||||
std::string msg = util::fmt("\"when\" statement referring to locals without an "
|
||||
"explicit [] capture is deprecated: %s",
|
||||
"explicit [] capture: %s",
|
||||
vars.c_str());
|
||||
ws->Warn(msg.c_str());
|
||||
ws->Error(msg.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue