From 4f5d3b50b8eab80a656fd3649b76f2f0d59d183e Mon Sep 17 00:00:00 2001 From: Pawel Kojma Date: Wed, 11 Feb 2026 12:59:22 +0100 Subject: [PATCH] Check only toplevel statements for class members Signed-off-by: Pawel Kojma --- src/V3LinkResolve.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/V3LinkResolve.cpp b/src/V3LinkResolve.cpp index adfeedf7c..702c68f09 100644 --- a/src/V3LinkResolve.cpp +++ b/src/V3LinkResolve.cpp @@ -73,6 +73,8 @@ class LinkResolveVisitor final : public VNVisitor { void visit(AstClass* nodep) override { VL_RESTORER(m_classp); m_classp = nodep; + nodep->foreachMember( + [&](AstClass* const, AstVar* const varp) { varp->varType(VVarType::MEMBER); }); iterateChildren(nodep); } void visit(AstConstraint* nodep) override { @@ -120,8 +122,6 @@ class LinkResolveVisitor final : public VNVisitor { } void visit(AstVar* nodep) override { iterateChildren(nodep); - if (m_classp && !nodep->isParam() && !VN_IS(nodep->backp(), SelLoopVars)) - nodep->varType(VVarType::MEMBER); if (m_ftaskp) nodep->funcLocal(true); if (nodep->isSigModPublic()) { nodep->sigModPublic(false); // We're done with this attribute