verilator/test_regress/t/t_class_fwd_cc.v
Krzysztof Bieganski 0b96789e65
Add error on static access to non-static class member (#4072)
Before this patch, it was possible to access non-static class members using
static access, which resulted in C++ compilation errors. This adds
verilation-time checks for such situations.
2023-03-27 10:46:51 -04:00

23 lines
584 B
Systemverilog

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2020 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
package Pkg;
typedef class Fwd;
virtual class Virt;
pure virtual function Fwd get_root();
endclass
class Ext extends Virt;
virtual function Fwd get_root();
return Fwd::m_uvm_get_root();
endfunction
endclass
class Fwd;
static function Fwd m_uvm_get_root();
return null;
endfunction
endclass
endpackage