I was quoting Rom 4:5. God does justify the ungodly. He declares them righteous in justification. They aren’t righteous before his declaration.
Westminster:
“Those whom God effectually calleth, he also freely justifieth: not by infusing righteousness into them, but by pardoning their sins and by accounting and accepting their persons as righteous;”
This says, as I do, that he accepts them as righteous as an effect of justification. I don’t think you’ll find Reformation standards saying that we are righteous before God justifies us. If we were already righteous, the verdict would be one based on our merit.
The full throated Reformed understanding is to say that God
constitutes and
declares us righteous in our justification. It is not a declaration that has no legal ground. The legal grounds of the declaration is the actual righteousness of Christ imputed to the believer.
Westminster:
Q. 70. What is justification?
A. Justification is an act of God’s free grace unto sinners,
[286] in which he pardoneth all their sins, accepteth and accounteth their persons righteous in his sight;
[287] not for any thing wrought in them, or done by them,
[288] but only for the perfect obedience and full satisfaction of Christ, by God imputed to them,
[289] and received by faith alone.
[290]
Westminster says that God's justification of sinners is based on the "perfect obedience and full satisfaction of Christ, by God imputed to them."
So the imputation comes along with the justification. It may not be temporally or logically prior to being declared righteous. But justification includes both a constituting (imputation) and declaring to be righteous. In other words, without the imputed righteousness of Christ there could be no justification of sinners.