Class lifetime

as i was looking in the SV LRM i saw class declaration as [virtual] class [lifetime] class_identifier

is it referring to

class static sample;
endclass : sample

/ or /

class automatic sample;
endclass : automatic

if so is it works similar like we declare in functions i.e

function static sample();
endfunction : sample

which defines the local variables of function as “static” ?

In reply to Mahantha Deeksha S B:

It has been illegal to declare class methods with a static lifetime since 1800-2009. The default lifetime of all variables declared inside a method is automatic. The 1800-2023 LRM has just removed [lifetime] from the class declaration syntax.

1 Like