Add error on static virtual functions (#7932)

This commit is contained in:
Igor Zaworski
2026-07-14 05:12:26 -07:00
committed by GitHub
parent 3afb7e1a21
commit 3b43b304a3
4 changed files with 35 additions and 0 deletions
+4
View File
@@ -1740,6 +1740,10 @@ 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,