https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89882
--- Comment #4 from Arseny Solokha <asolokha at gmx dot com> --- (In reply to Jakub Jelinek from comment #2) > So, is the PR about not being to understand it is a fix-it remove hint > (which is obvious if you e.g. use -fdiagnostics-generate-patch or > -fdiagnostics-parseable-fixits), something else? The second line of dashes have admittedly confused me at first. I've got a suspicion that it actually may be a remove hint, but then adding equally superfluous virtual or override specifiers yielded no such hint, which made me confident that there's some bug in there anyway, either in emitting those mysterious dashes when they're not needed or not emitting them when they should be printed. It turned out that those dashes are really a remove hint, and the change since gcc 7 was intentional, so I'd just close the PR as INVALID. Sorry, I'd rather stay aside from the UX issues and their discussion, and I won't insist that the current diagnostic is hard to understand. I also don't have any suggestions for improvement here beside the one to mark both the offending keyword and an adjacent one (either left- or rightward) and propose to replace them w/ only that adjacent - which is also far from ideal. Or maybe the line number column could be somehow abused, like: 1 | friend void (---) → | ^~~~~~ which is arguably not any clear than the original.