On 1/25/19 8:48 AM, David Malcolm wrote:
PR c++/89036 reports an ICE due to this assertion failing

1136      /* A class should never have more than one destructor.  */
1137      gcc_assert (!current_fns || via_using || !DECL_DESTRUCTOR_P (method));

on this template with a pair of dtors, with
mutually exclusive "requires" clauses:

template<typename T>
struct Y {
     ~Y() requires(true) = default;
     ~Y() requires(false) {}
};

(is this valid?  my knowledge of this part of C++ is fairly hazy)

Yes. A more sensible example would have 'true' and 'false' replaced by something determined from the template parms.


Nathan introduced this assertion as part of:

   ca9219bf18c68a001d62ecb981bc9176b0feaf12 (aka r251340):
     2017-08-24  Nathan Sidwell  <nat...@acm.org>
        Conversion operators kept on single overload set

I'd just drop the assert at this point.

nathan

--
Nathan Sidwell

Reply via email to