Bug 53845 - Another "error reporting routines re-entered" issue
Summary: Another "error reporting routines re-entered" issue
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.1
: P3 normal
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-03 19:58 UTC by Jeremiah Willcock
Modified: 2012-10-05 19:39 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-07-03 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremiah Willcock 2012-07-03 19:58:39 UTC
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.
Comment 1 Paolo Carlini 2012-07-03 21:44:41 UTC
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.
Comment 2 davidxl 2012-07-13 00:10:07 UTC
(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
Comment 3 Paolo Carlini 2012-10-04 15:34:56 UTC
With current mainline the testcase is actually accepted. Is it really invalid?
Comment 4 Jeremiah Willcock 2012-10-04 15:43:30 UTC
I don't know whether it is valid or not after all of the trimming I did on it.
Comment 5 Paolo Carlini 2012-10-04 15:55:26 UTC
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.
Comment 6 Paolo Carlini 2012-10-05 19:39:53 UTC
For sure the "error reporting routines re-entered" is gone.