I've submitted a patch for contracts (review linked to this) that adds trailing objects to NullStmt. This patch contains the changes to make that possible.
Diff Detail
Event Timeline
This looks like a NFC change.
Given that the next patch moves these methods out of line, you might consider introducing them out of line here (and moving the constructors out of line). That would make the next patch easier to review because the addition of assertion handling would be move visible.
You could also state in the commit message why this is necessary to make your contracts possible. From looking at the follow-up patch, it seems that you want to centralize creation so that it doesn't have to be duplicated in the follow-up patch.
LGTM, but I'm new here, so you may want to wait for another reviewer if you wish.
Thanks. I'm not planning to move forward with this until the contracts patch is ready (it might change enough to not even require this); that should leave plenty of time for others to take a look.