diff --git a/src/V3Fork.cpp b/src/V3Fork.cpp index 7d78c085056..fc0d7da023e 100644 --- a/src/V3Fork.cpp +++ b/src/V3Fork.cpp @@ -419,7 +419,7 @@ class DynScopeVisitor final : public VNVisitor { [](AstVarRef* refp) { return refp->varp()->isFuncLocal(); })) { nodep->user2(true); // Put it in a fork to prevent lifetime issues with the local - auto* forkp = new AstFork{nodep->fileline(), "", nullptr}; + AsFork* const forkp = new AstFork{nodep->fileline(), "", nullptr}; forkp->joinType(VJoinType::JOIN_NONE); nodep->replaceWith(forkp); forkp->addStmtsp(nodep);