Fix IGNOREDRETURN to not warn on void-cast static function calls.

This commit is contained in:
Wilson Snyder 2023-09-15 19:01:11 -04:00
parent 188cf85b3f
commit d840c612d4
3 changed files with 13 additions and 2 deletions

View File

@ -35,6 +35,7 @@ Verilator 5.015 devel
* Fix reference to extended class in parameterized class (#4466).
* Fix display %x formatting of real.
* Fix mis-warning on #() in classes' own functions.
* Fix IGNOREDRETURN to not warn on void-cast static function calls.
* Fix ZERODLY to not warn on 'wait(0)'.

View File

@ -3558,9 +3558,11 @@ statement_item<nodep>: // IEEE: statement_item
// // Alternative would be shim with new AstVoidStmt.
| yVOID yP_TICK '(' task_subroutine_callNoMethod ')' ';'
{ $$ = $4;
FileLine* const newfl = new FileLine{$$->fileline()};
AstNode* callp = $$;
while (AstDot* const dotp = VN_CAST(callp, Dot)) callp = dotp->rhsp();
FileLine* const newfl = new FileLine{callp->fileline()};
newfl->warnOff(V3ErrorCode::IGNOREDRETURN, true);
$$->fileline(newfl);
callp->fileline(newfl);
$$ = VN_AS($$, NodeExpr)->makeStmt(); }
| yVOID yP_TICK '(' expr '.' task_subroutine_callNoMethod ')' ';'
{ $$ = new AstDot{$5, false, $4, $6};

View File

@ -15,6 +15,12 @@ module t (clk);
side_effect += in + 1;
endfunction
class Cls;
static function int initialize();
return 6;
endfunction
endclass
initial begin
int got;
side_effect = 1;
@ -30,6 +36,8 @@ module t (clk);
void'(f1(30));
if (side_effect != 64) $stop;
//
void'(Cls::initialize());
//
$write("*-* All Finished *-*\n");
$finish;
end