diff --git a/src/V3LinkResolve.cpp b/src/V3LinkResolve.cpp index d28074c9d..773abb4e3 100644 --- a/src/V3LinkResolve.cpp +++ b/src/V3LinkResolve.cpp @@ -120,7 +120,7 @@ class LinkResolveVisitor final : public VNVisitor { } void visit(AstVar* nodep) override { iterateChildren(nodep); - if (m_classp && !nodep->isParam()) nodep->varType(VVarType::MEMBER); + 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