mirror of
https://github.com/verilator/verilator.git
synced 2026-10-02 16:13:34 +02:00
Fix marking inherited virtual functions
This commit is contained in:
@@ -1753,10 +1753,6 @@ class TaskVisitor final : public VNVisitor {
|
||||
<< nodep->prettyNameQ());
|
||||
}
|
||||
|
||||
if (nodep->isStatic() && nodep->isVirtual()) {
|
||||
nodep->v3error("Static methods cannot be virtual");
|
||||
}
|
||||
|
||||
const bool noInline = m_statep->ftaskNoInline(nodep);
|
||||
const bool needsNonInlineCFunc = m_statep->ftaskNeedsNonInlineCFunc(nodep);
|
||||
// Warn if not inlining an impure ftask (unless method, recursive,
|
||||
|
||||
@@ -7234,6 +7234,8 @@ class WidthVisitor final : public VNVisitor {
|
||||
nodep->v3error("The 'constraint_mode' method is built-in and cannot be overridden"
|
||||
" (IEEE 1800-2023 18.9)");
|
||||
}
|
||||
if (nodep->isStatic() && nodep->isVirtual())
|
||||
nodep->v3error("Static methods cannot be virtual");
|
||||
if (nodep->classMethod() && nodep->name() == "new") {
|
||||
if (nodep->isVirtual())
|
||||
nodep->v3error("class 'new()' cannot be virual (IEEE 1800-2023 18.3)");
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
%Error: t/t_class_static_virtual_method_bad.v:8:23: Static methods cannot be virtual
|
||||
: ... note: In instance '$unit.Foo'
|
||||
8 | static virtual task foo();
|
||||
| ^~~
|
||||
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
|
||||
|
||||
@@ -31,6 +31,9 @@ module t;
|
||||
|
||||
any_monitor #(q_t, q_t) imon;
|
||||
|
||||
initial $stop;
|
||||
initial begin
|
||||
imon.run_phase();
|
||||
$stop;
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
||||
Reference in New Issue
Block a user