]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: Fix deferred noexcept on constructor [PR93901].
authorJason Merrill <jason@redhat.com>
Tue, 10 Mar 2020 21:31:33 +0000 (17:31 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 11 Mar 2020 02:01:03 +0000 (22:01 -0400)
My change in r10-4394 to only update clones when we actually instantiate a
deferred noexcept-spec broke this because deferred parsing updates the
primary function but not the clones.  For GCC 10, let's just revert it.

gcc/cp/ChangeLog
2020-03-10  Jason Merrill  <jason@redhat.com>

PR c++/93901
* pt.c (maybe_instantiate_noexcept): Always update clones.

gcc/cp/ChangeLog
gcc/cp/pt.c

index b60b1ecc60463c39bb0431c7987ae6e7fb010abb..9e0b48886ad1a58acd0deb696e4d14ddf0afd194 100644 (file)
@@ -1,3 +1,8 @@
+2020-03-10  Jason Merrill  <jason@redhat.com>
+
+       PR c++/93901
+       * pt.c (maybe_instantiate_noexcept): Always update clones.
+
 2020-03-10  Jason Merrill  <jason@redhat.com>
 
        PR c++/93956
index 179716b56800ef15fc9db7b5d1b8ad8d6d7e7b4a..cb237ba0d9d8f2efbcdb88d0d920edc1806518a5 100644 (file)
@@ -25097,14 +25097,14 @@ maybe_instantiate_noexcept (tree fn, tsubst_flags_t complain)
       TREE_TYPE (fn) = build_exception_variant (fntype, spec);
       if (orig_fn)
        TREE_TYPE (orig_fn) = TREE_TYPE (fn);
+    }
 
-      FOR_EACH_CLONE (clone, fn)
-       {
-         if (TREE_TYPE (clone) == fntype)
-           TREE_TYPE (clone) = TREE_TYPE (fn);
-         else
-           TREE_TYPE (clone) = build_exception_variant (TREE_TYPE (clone), spec);
-       }
+  FOR_EACH_CLONE (clone, fn)
+    {
+      if (TREE_TYPE (clone) == fntype)
+       TREE_TYPE (clone) = TREE_TYPE (fn);
+      else
+       TREE_TYPE (clone) = build_exception_variant (TREE_TYPE (clone), spec);
     }
 
   return true;