This example causes "Error reporting routines re-entered", and seems to be different from those reported so far: struct a {}; template<typename> struct b; template<> struct b<a> {static const int v = 3;}; template <typename L> struct c { static_assert(b<L>::v == 3, ""); using t = int; }; template <typename E, typename T> auto d(T x) -> decltype(((x.template e<E>()))) {return ((x.template e<E>()));} template <typename B> struct f { template <typename E> struct h { using w = int; typename c<E>::t x; }; template <typename E> decltype(d<typename h<E>::w>(*(B*)nullptr)) e(); }; struct g { template <typename> int e(); }; int main(int argc, char** argv) { d<a>(f<g>{}); return 0; } It is probably invalid code. Some small variations on it cause infinite loops (recursion depth exceeded), which also seem to be incorrect. The full error message for the code above with 4.7.1 is: ‘ Internal compiler error: Error reporting routines re-entered. Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
push_tinst_level tries to error out even when called (during diagnostics) by a deduction_tsubst_fntype which is passed a complain not including tf_error.
(In reply to comment #1) > push_tinst_level tries to error out even when called (during diagnostics) by a > deduction_tsubst_fntype which is passed a complain not including tf_error. Similar ICE can also be triggered in many cases with -fdump-tree-all option. The dumper tries to print template parameters which triggers template instantiation (odd). The instantiation may fail for unknown reason causing the ICE. David
With current mainline the testcase is actually accepted. Is it really invalid?
I don't know whether it is valid or not after all of the trimming I did on it.
Minimally, can somebody check clang? Lately we fixed quite a few "error reporting routines re-entered" issues and if the testcase isn't even invalid there is no point in keeping the Bug report open. Thanks.
For sure the "error reporting routines re-entered" is gone.