Is this gcc 12.1 const problem a bug or feature
It’s a bug. I filed a bug report and the issue has already been verified coming from this commit.
The ticket has been assigned and the resolution has a targeted milestone of version 12.2 – so we can hope for a quick fix.