diff mbox

small C++ PATCH to instantiate_template_1

Message ID 546B596E.6020905@redhat.com
State New
Headers show

Commit Message

Jason Merrill Nov. 18, 2014, 2:36 p.m. UTC
While looking at 55992 I noticed that we weren't pushing into dependent 
scope properly; we need to pass the "entering scope" flag to 
tsubst_aggr_type so that we get the version of the type with the 
members.  This isn't enough to fix 55992, but may well fix other bugs.

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

Patch

commit c12c225ae102f77c6b4b1f98a69adbee474cb3a3
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Nov 17 16:26:45 2014 -0500

    	* pt.c (instantiate_template_1): Use tsubst_aggr_type for context.

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index c0f3b8c..6661325 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -15856,8 +15856,8 @@  instantiate_template_1 (tree tmpl, tree orig_args, tsubst_flags_t complain)
     ++processing_template_decl;
   if (DECL_CLASS_SCOPE_P (gen_tmpl))
     {
-      tree ctx = tsubst (DECL_CONTEXT (gen_tmpl), targ_ptr,
-			 complain, gen_tmpl);
+      tree ctx = tsubst_aggr_type (DECL_CONTEXT (gen_tmpl), targ_ptr,
+				   complain, gen_tmpl, true);
       push_nested_class (ctx);
     }
   /* Substitute template parameters to obtain the specialization.  */