@@ -3395,7 +3395,13 @@ cp_fold (tree x, fold_flags_t flags)
Do constexpr expansion of expressions where the call itself is not
constant, but the call followed by an INDIRECT_REF is. */
if (callee && DECL_DECLARED_CONSTEXPR_P (callee)
- && !flag_no_inline)
+ && !flag_no_inline
+ /* Don't invoke it on dtors. On
+ !targetm.cxx.cdtor_returns_this () it won't do anything as it
+ has void type, so don't do it on
+ targetm.cxx.cdtor_returns_this () targets either for
+ consistency. */
+ && !DECL_DESTRUCTOR_P (callee))
{
mce_value manifestly_const_eval = mce_unknown;
if (flags & ff_mce_false)
@@ -0,0 +1,6 @@
+// PR c++/114426
+// { dg-do compile }
+
+struct A { virtual ~A (); };
+struct B : virtual A { virtual void foo () = 0; };
+struct C : B { C () {} };