mirror of
https://github.com/verilator/verilator.git
synced 2025-01-21 05:44:03 +00:00
0b96789e65
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.
23 lines
584 B
Systemverilog
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
|