diff --git a/docs/CONTRIBUTORS b/docs/CONTRIBUTORS index b5a99ea6c..d4ed0f96f 100644 --- a/docs/CONTRIBUTORS +++ b/docs/CONTRIBUTORS @@ -197,6 +197,7 @@ Nathan Graybeal Nathan Kohagen Nathan Myers Nick Brereton +Nikolay Puzanov Nolan Poe Oleh Maksymenko Patrick Stewart diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index c9174bcce..5054de9dd 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -3406,7 +3406,7 @@ class LinkDotResolveVisitor final : public VNVisitor { if (!baseFuncp || !baseFuncp->pureVirtual()) continue; const bool existsInDerived = foundp && !foundp->imported(); if (m_statep->forPrimary() && !existsInDerived - && !derivedClassp->isInterfaceClass()) { + && !derivedClassp->isInterfaceClass() && !derivedClassp->isVirtual()) { derivedClassp->v3error( "Class " << derivedClassp->prettyNameQ() << impOrExtends << baseClassp->prettyNameQ() diff --git a/test_regress/t/t_class_virtual_extends_pure.py b/test_regress/t/t_class_virtual_extends_pure.py new file mode 100644 index 000000000..363cbe649 --- /dev/null +++ b/test_regress/t/t_class_virtual_extends_pure.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of either the GNU Lesser General Public License Version 3 +# or the Perl Artistic License Version 2.0. +# SPDX-FileCopyrightText: 2026 Wilson Snyder +# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 + +import vltest_bootstrap + +test.scenarios('vlt') + +test.lint() + +test.passes() diff --git a/test_regress/t/t_class_virtual_extends_pure.v b/test_regress/t/t_class_virtual_extends_pure.v new file mode 100644 index 000000000..7619aa264 --- /dev/null +++ b/test_regress/t/t_class_virtual_extends_pure.v @@ -0,0 +1,23 @@ +// DESCRIPTION: Verilator: Verilog Test module +// +// This file ONLY is placed under the Creative Commons Public Domain. +// SPDX-FileCopyrightText: 2026 Wilson Snyder +// SPDX-License-Identifier: CC0-1.0 + +virtual class Base; + pure virtual function void f0(); +endclass + +virtual class Child extends Base; + pure virtual function void f1(); +endclass + +class Impl extends Child; + virtual function void f0(); + endfunction + virtual function void f1(); + endfunction +endclass + +module t; +endmodule