# VERILOG052: Functions and tasks declared outside of a class should have an explicit lifetime ## Summary ```{raw} html

Count: 1

ReliabilitySecurityMaintainabilityCode attributeEffort to fixTags
MEDIUM--Intentionality | Logical5minsynthesis, vscode, linter, simulation
``` ## Description ```{raw} html

Noncompliant code example

function logic [2:0] foo( // Noncompliant: No "automatic" or "static" lifetime
  logic [2:0] a,
  logic [2:0] b
);
  return a ^ b;
endfunction : foo

Compliant solution

function automatic logic [2:0] foo(
  logic [2:0] a,
  logic [2:0] b
);
  return a ^ b;
endfunction : foo

Functions and tasks declared outside of a class should have an explicit lifetime.

``` ## Parameters No parameters. ```{raw} html ```