https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120124
Ribbon Otter <whiteredredcat at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |whiteredredcat at gmail dot com
--- Comment #2 from Ribbon Otter <whiteredredcat at gmail dot com> ---
Created attachment 63614
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63614&action=edit
comments out complex lambda error code
We likely want a better fix, but confirming Andrew Pinski's idea, if I comment
out the code for printing out a lambda's type beyond just the string <lambda>
then the code reports the error successfully. Even if I increase the nesting to
899 times (G++'s default maximum), the error is printed successfully.
How do we feel about a patch which detects how long the error message is
already and prints the current long form if the error message is still short
and prints <lambda ...> (that is a literal "...") if the error message is
longer than some constant? or perhaps if the current line is longer than some
constant?
or perhaps we should look at tree to see how far nested we are? and if we are
nested beyond some point, we could switch to printing shorter type names, for
lambda and maybe other types too in the future.
Rather than writing code that only affects lambda error messages, we could
maybe modify output_buffer_append_r or pp_append_r to turn into a no-op if the
pp_buffer grows too long. Maybe adding "..." or "[error message terminated to
avoid crash from extremely long error message]" to the end of the buffer.