New features in GCC 16: Improved error messages and SARIF output(developers.redhat.com) |
New features in GCC 16: Improved error messages and SARIF output(developers.redhat.com) |
Also, that interactive `-fanalyze`-output with the pointer visualisation looks super handy!
Happy to see there's still focus on the DX in GCC. C and C++ sorely needs it.
After more than 20 years in c++, I gave up that the situation will ever really be fixed vs constantly being made better at the margins, but not as fast as new ideas get added to the language.
Concepts at least tells you which criteria you didn't satisfy (as long as the concept is correct...), which - admittedly - feels like putting a bandaid on bullet wound.
Hence why SARIF has seen big adoption, as they hope that by exposing that , there are others ways to have others have tools that process SARIF.
I looked into using SARIF once before and found it's an enormous over-engineered design-by-committee spec, but I guess it's still better than regexes (do people really do that?).
Rust has the same problem as templates with macros. We haven't had a strong need to customize the macrosl evaluation much, but I could very much see us special casing macros that are function like, or have macro arms that can only be a handful of things in order treat them different so diagnostics get better. The only thing that comes to mind thar we do today, is that when a macro call falls through (no macro arm matches), we retry it adding commas in between expressions to see if it was just a typo.
Also, so far I would say they haven't been getting people rushing out to use them anyway, as C++20 is still too new for many projects.
Even GCC only now changed to C++20 as default mode.
Rust can say hey, this code treats Mallard as if it's a Duck, did you mean for this Mallard to implement Duck? If so, try writing #[derive(Duck)]
But for Concepts Lite the compiler needs to guess that you wanted Mallard to match this requirement that Ducks can quack, and observe that Mallard's quack has a slightly wrong signature so it doesn't match and so that's probably the mistake.
To improve error messages, not so much.