Make sure we aren't trying to do a nested instantiation in template context.
authorJason Merrill <jason@redhat.com>
Thu, 10 May 2018 18:40:55 +0000 (14:40 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 10 May 2018 18:40:55 +0000 (14:40 -0400)
* pt.c (instantiate_decl): Make sure we aren't trying to do a nested
instantiation in template context.

From-SVN: r260124

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

index d175277af2db2d8440841e18bd23602c234283db..02d35cba4ec5f128443955ad0edc96fb3a87f711 100644 (file)
@@ -1,5 +1,8 @@
 2018-05-09  Jason Merrill  <jason@redhat.com>
 
+       * pt.c (instantiate_decl): Make sure we aren't trying to do a nested
+       instantiation in template context.
+
        * class.c (vbase_has_user_provided_move_assign): Use
        user_provided_p.
 
index e8346d3bf589efa06e551bc2d2d07c0df68bc38f..790d6ea25e9bcf507b0319e16040c99a65ce8e04 100644 (file)
@@ -23886,6 +23886,7 @@ instantiate_decl (tree d, bool defer_ok, bool expl_inst_class_mem_p)
     push_to_top_level ();
   else
     {
+      gcc_assert (!processing_template_decl);
       push_function_context ();
       cp_unevaluated_operand = 0;
       c_inhibit_evaluation_warnings = 0;