From aecf38e3ad77ed6932a6929b26523adf89b8b7f9 Mon Sep 17 00:00:00 2001 From: Krzysztof Bieganski Date: Thu, 29 Aug 2024 16:39:54 +0200 Subject: [PATCH] Fix V3Randomize compile error on old GCC (#5403) (#5417). No functional change intended. --- src/V3Randomize.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/V3Randomize.cpp b/src/V3Randomize.cpp index 0833db2d9..9570277c5 100644 --- a/src/V3Randomize.cpp +++ b/src/V3Randomize.cpp @@ -1207,12 +1207,13 @@ class RandomizeVisitor final : public VNVisitor { return new AstBegin{fl, "", stmtsp, false, true}; } static AstNodeStmt* wrapIfRandMode(AstClass* classp, AstVar* const varp, AstNodeStmt* stmtp) { - return VN_AS(wrapIfMode({.asInt = varp->user1()}, getRandModeVar(classp), stmtp), - NodeStmt); + const RandomizeMode rmode = {.asInt = varp->user1()}; + return VN_AS(wrapIfMode(rmode, getRandModeVar(classp), stmtp), NodeStmt); } static AstNode* wrapIfConstraintMode(AstClass* classp, AstConstraint* const constrp, AstNode* stmtp) { - return wrapIfMode({.asInt = constrp->user1()}, getConstraintModeVar(classp), stmtp); + const RandomizeMode rmode = {.asInt = constrp->user1()}; + return wrapIfMode(rmode, getConstraintModeVar(classp), stmtp); } static AstNode* wrapIfMode(const RandomizeMode mode, AstVar* modeVarp, AstNode* stmtp) { FileLine* const fl = stmtp->fileline();