https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64931
Bug ID: 64931 Summary: ICE on function with deduced return type and input is instantiated template class Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sneves at dei dot uc.pt Minimal example: template<typename T, unsigned long N> struct array { T data[N]; }; auto copy(array<int, 32> const& x) { return x; } This only seems to result in ICE if a) `copy` has deduced return type with value semantics, i.e. `auto` but not `decltype(auto)`, and b) if the `array` struct is a template, and `copy` takes in a specific instantiation of `array`. Verified to ICE in GCC 4.8.2, 4.9.2, and 5.0.0 20150202.