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) {}
};
Nathan introduced this assertion as part of:
ca9219bf18c68a001d62ecb981bc9176b0feaf12 (aka r251340):
2017-08-24 Nathan Sidwell <nathan@acm.org>
Conversion operators kept on single overload set
which, amongst other changes to add_method had this:
/* A class should never have more than one destructor. */
- if (current_fns && DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (method))
- return false;
+ gcc_assert (!current_fns || !DECL_DESTRUCTOR_P (method));
The following patch drops the assertion (I already had to generalize
the assertion in r268041 to fix PR c++/88699).
gcc/cp/ChangeLog:
PR c++/89036
* class.c (add_method): Drop destructor assertion.
gcc/testsuite/ChangeLog:
PR c++/89036
* g++.dg/concepts/pr89036.C: New test.
From-SVN: r268847
+2019-02-13 David Malcolm <dmalcolm@redhat.com>
+
+ PR c++/89036
+ * class.c (add_method): Drop destructor assertion.
+
2019-02-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/88986
}
}
- /* A class should never have more than one destructor. */
- gcc_assert (!current_fns || via_using || !DECL_DESTRUCTOR_P (method));
-
current_fns = ovl_insert (method, current_fns, via_using);
if (!COMPLETE_TYPE_P (type) && !DECL_CONV_FN_P (method)
+2019-02-13 David Malcolm <dmalcolm@redhat.com>
+
+ PR c++/89036
+ * g++.dg/concepts/pr89036.C: New test.
+
2019-02-13 Tamar Christina <tamar.christina@arm.com>
PR target/88847
--- /dev/null
+// { dg-do compile { target c++11 } }
+// { dg-options "-fconcepts" }
+
+template<typename T>
+struct Y {
+ ~Y() requires(true) = default;
+ ~Y() requires(false) {}
+};