Ping.

Could someone please take a look at this patch?

Thanks,
Ilia

> 
> Среда, 4 ноября 2026, 03:36 +03:00 от илья ролдугин <[email protected]
> >:
> Hello,
> 
> This patch fixes PR c++/106207, an internal compiler error in
> changed_line::apply_fixit when compiling code with both
> -ftrack-macro-expansion=0 and -fdiagnostics-generate-patch.
> 
> When macro tracking is disabled, macro tokens receive coarse locations.
> Subsequent shifts by get_effective_column can cause start_offset or
> next_offset to become negative. Instead of asserting via gcc_assert,
> handle this as an invalid edit and return false (matching the behavior
> already present for offsets that exceed the line length).
> 
> Tested on x86_64-pc-linux-gnu:
> - make check-c++ RUNTESTFLAGS="dg.exp=pr106207.C" (passes across all
> standards)
> - make check-c++ RUNTESTFLAGS="dg.exp=diagnostic/*" (3328 passes, 0
> unexpected failures)
> 
> As I do not have write access to the GCC repository, could someone
> please commit this for me if approved?
> 
> PR c++/106207
> 
> gcc/ChangeLog:
> 
> * diagnostics/changes.cc (changed_line::apply_fixit): Return false
> instead of asserting if start_offset or next_offset is negative.
> 
> gcc/testsuite/ChangeLog:
> 
> * g++.dg/diagnostic/pr106207.C: New test.
> 
> Signed-off-by: Ilia Roldugin <[email protected]>
> 
>

Reply via email to