Using "&=" results in -Warith-conversion with recent gcc, so use an explicit case to avoid it. This fixes allheaders unit test failure. Closes #22477.