]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pt.c (instantiate_template_1): Keep processing_template_decl set if there are depende...
authorJason Merrill <jason@redhat.com>
Fri, 31 Aug 2012 02:49:33 +0000 (22:49 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 31 Aug 2012 02:49:33 +0000 (22:49 -0400)
* pt.c (instantiate_template_1): Keep processing_template_decl set
if there are dependent args.

From-SVN: r190825

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

index 845f0b4ea6caf13fc357754c284bf2a2a429a7ad..2eca6785b26dba6a23d405076db134b4c26d4f0a 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-30  Jason Merrill  <jason@redhat.com>
+
+       * pt.c (instantiate_template_1): Keep processing_template_decl set
+       if there are dependent args.
+
 2012-08-25  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/51421
index f8ff1dfeed6a9a0994f4b2252b9f38f6beb93096..54d92dfcf4e7620c7cf8770887229ecccdd9d503 100644 (file)
@@ -14373,6 +14373,10 @@ instantiate_template_1 (tree tmpl, tree orig_args, tsubst_flags_t complain)
   /* Instantiation of the function happens in the context of the function
      template, not the context of the overload resolution we're doing.  */
   push_to_top_level ();
+  /* If there are dependent arguments, e.g. because we're doing partial
+     ordering, make sure processing_template_decl stays set.  */
+  if (uses_template_parms (targ_ptr))
+    ++processing_template_decl;
   if (DECL_CLASS_SCOPE_P (gen_tmpl))
     {
       tree ctx = tsubst (DECL_CONTEXT (gen_tmpl), targ_ptr,