[Bug c++/50075] [C++0x] ICE related to parameter deduction and initializer_list

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Aug 13 23:02:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50075

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011-08-13
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.7.0
     Ever Confirmed|0                           |1

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-08-13 22:00:34 UTC ---
The problem is the recursion:

template <typename T>
auto make_array(const std::initializer_list<T> & il) ->
decltype(make_array(il))

You're declaring make_array to have the same return type as itself.  4.6
happily goes down the rabbit hole until it runs out of stack.  4.7 complains
and then crashes for another reason, which I will fix.



More information about the Gcc-bugs mailing list