OSDN Git Service

PR c++/60046
[pf3gnuchains/gcc-fork.git] / gcc / cp / pt.c
index ed33198..f2b2f9b 100644 (file)
@@ -18093,6 +18093,10 @@ maybe_instantiate_noexcept (tree fn)
 {
   tree fntype, spec, noex, clone;
 
+  /* Don't instantiate a noexcept-specification from template context.  */
+  if (processing_template_decl)
+    return;
+
   if (DECL_CLONED_FUNCTION_P (fn))
     fn = DECL_CLONED_FUNCTION (fn);
   fntype = TREE_TYPE (fn);