Defining a class within a systemverilog macro

If you are getting this error message in the definition of this macro, not in the use of this macro, then the compiler thinks
endclass
is not part of the macro. Check for extra characters after the last backslash ‘
</span>’. Also,
T::foo_c
probably should just be
foo_c
.