diff --git a/src/V3Ast.h b/src/V3Ast.h index 2c748a9dc..ed34ac0dd 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -2503,7 +2503,7 @@ protected: static void dumpJsonStr(std::ostream& os, const std::string& name, const std::string& val); static void dumpJsonPtr(std::ostream& os, const std::string& name, const AstNode* const valp); -private: +protected: void iterateListBackwardsConst(VNVisitorConst& v); // For internal use only. diff --git a/src/V3AstNodeOther.h b/src/V3AstNodeOther.h index 06aee97a0..c4c9dfd94 100644 --- a/src/V3AstNodeOther.h +++ b/src/V3AstNodeOther.h @@ -2353,9 +2353,7 @@ public: extendsp->classp()->foreachMember(f); } for (AstNode* stmtp = stmtsp(); stmtp; stmtp = stmtp->nextp()) { - if (T_Node* memberp = AstNode::privateCast(stmtp)) { - f(this, memberp); - } + if (AstNode::privateTypeTest(stmtp)) f(this, static_cast(stmtp)); } } // Same as above, but stops after first match @@ -2370,8 +2368,8 @@ public: if (extendsp->classp()->existsMember(p)) return true; } for (AstNode* stmtp = stmtsp(); stmtp; stmtp = stmtp->nextp()) { - if (T_Node* memberp = AstNode::privateCast(stmtp)) { - if (p(this, memberp)) return true; + if (AstNode::privateTypeTest(stmtp)) { + if (p(this, static_cast(stmtp))) return true; } } return false;