diff mbox series

[pushed] c++: Fix deferred noexcept on constructor [PR93901].

Message ID 20200311020044.21291-1-jason@redhat.com
State New
Headers show
Series [pushed] c++: Fix deferred noexcept on constructor [PR93901]. | expand

Commit Message

Li, Pan2 via Gcc-patches March 11, 2020, 2 a.m. UTC
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.

Tested x86_64-pc-linux-gnu, applying to trunk.

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

	PR c++/93901
	* pt.c (maybe_instantiate_noexcept): Always update clones.
---
 gcc/cp/pt.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)


base-commit: b269a014771776f860730874095dffb34839a466
diff mbox series

Patch

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 179716b5680..cb237ba0d9d 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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;