The problem is that the macro unwinder code is changing the original diagnostic type and not restoring it, so the code detecting that we ICE fails to abort, which triggers another ICE, and so on. But there is no point in modifying the original diagnostic, we can simply create a temporary copy and use that for macro unwinding.
Bootstrapped and regression tested. I have tested that it fixes the infiite ICE in the original example, but I am not sure how to add a testcase for this because I expect the original ICE to be fixed soon so the testcase will be useless. Dodji, does it look ok? I am not sure how much testsuite coverage we have for the macro unwinder, so I hope I didn't mess it up in some non-trivial testcase. OK? 2012-10-17 Manuel López-Ibáñez <m...@gcc.gnu.org> gcc/ PR c++/54928 * tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Do not modify diagnostic passed as argument but a temporary copy.
pr54928.diff
Description: Binary data