Just putting this here because it's a pretty simple patch as it turns out.
Done:
- Increase -fcaret-diagnostics-max-lines default to 16.
- Add -fdiagnostics-show-line-numbers to disable the margin with the line numbers on the left
- Actually show the line numbers in all diagnostics.
- Fix up tests.
Sample output:
./array.cpp:98:1: error: static assertion failed due to requirement 'func()' 98 | static_assert( | ^ 99 | // I wonder if this works. 100 | // Also, what if it doesn't? 101 | func()); | ~~~~~~ 1 error generated.
I'm hopeful that defaulting this to true (which matches the GCC behavior) is reasonable, but I'm a bit worried about how downstreams will react to this. Specifically, I'm wondering about things like clang-cl integration in MSVC or clang use in Xcode, where diagnostics are being displayed other than on the command line.