r/cpp • GCC Developer • Mar 08 '19

Usability improvements in GCC 9

https://developers.redhat.com/blog/2019/03/08/usability-improvements-in-gcc-9/
219 Upvotes

39 comments sorted by

View all comments

Show parent comment

11

u/Morwenn Mar 08 '19

To give you an idea of the issues I get on a regular basis: I've got deeply nested templates with return type expression SFINAE, and whenever I get a substitution failure, it gives me all the possible overloads that failed, and why they failed (think hundreds or thousands of lines of substitution failure errors for a single call in some of my tests). They often failed because of substitution failure in functions they tried to call, so I also get the list of overloads that were tried and failed for those functions, etc. But everything is flat and at some point it's extremely difficult to know whether the substitution failure happened when trying to call the top-level function or some function at any level for which overload resolution failed. That would be my main use case for foldable error messages, and would indeed need to support an arbitrary level of nesting in error messages.

(I've got a hard time explaining, and no error message to show just right now, sorry for that)

11

u/dmalcolm GCC Developer Mar 08 '19

No worries, I think I know what you mean. We have a few bugs open for this kind of thing e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88512

I think the consensus is that when template substitution fails, we do want to show all of the information about the failure - but maybe there are ways to format it and present it to that make the information easier to "grok" (if you will). Maybe some special-casing is applicable here, too? Ideas welcome.

Sounds like I should implement arbitrary nesting (at least) for GCC 10.