https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109589

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Untested workaround, going to test it momentarily:

2023-04-21  Jakub Jelinek  <ja...@redhat.com>

        PR bootstrap/109589
        * system.h (class auto_mpz): Workaround PR62101 bug in GCC 4.8 and 4.9.
        * realmpfr.h (class auto_mpfr): Likewise.

--- gcc/system.h.jj     2023-04-20 09:36:09.097375720 +0200
+++ gcc/system.h        2023-04-21 20:13:09.212049563 +0200
@@ -714,8 +714,11 @@ public:
   auto_mpz (const auto_mpz &) = delete;
   auto_mpz &operator= (const auto_mpz &) = delete;

+#if GCC_VERSION < 4008 || GCC_VERSION >= 5000
+  /* GCC 4.8 and 4.9 don't support this, only fixed in PR62101 for 5.0.  */
   friend void mpz_clear (auto_mpz&) = delete;
   friend void mpz_init (auto_mpz&) = delete;
+#endif

 private:
   mpz_t m_mpz;
--- gcc/realmpfr.h.jj   2023-04-20 09:36:09.066376175 +0200
+++ gcc/realmpfr.h      2023-04-21 20:13:36.191663089 +0200
@@ -37,9 +37,12 @@ public:
   auto_mpfr (const auto_mpfr &) = delete;
   auto_mpfr &operator= (const auto_mpfr &) = delete;

+#if GCC_VERSION < 4008 || GCC_VERSION >= 5000
+  /* GCC 4.8 and 4.9 don't support this, only fixed in PR62101 for 5.0.  */
   friend void mpfr_clear (auto_mpfr&) = delete;
   friend void mpfr_init (auto_mpfr&) = delete;
   friend void mpfr_init2 (auto_mpfr&, mpfr_prec_t) = delete;
+#endif

 private:
   mpfr_t m_mpfr;

Reply via email to