Patchwork C++ PATCH for c++/56377 (missing template binding in diagnostic context)

login
register
mail settings
Submitter Jason Merrill
Date Feb. 22, 2013, 7:14 p.m.
Message ID <5127C3AF.8040804@redhat.com>
Download mbox | patch
Permalink /patch/222676/
State New
Headers show

Comments

Jason Merrill - Feb. 22, 2013, 7:14 p.m.
When we go to tsubst with explicit_args, we should put them in the tinst 
level.

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

Patch

commit 2eb09da9c9e09ce1e08b024b60594ed4acf02d00
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Feb 22 10:58:47 2013 -0500

    	PR c++/56377
    	* pt.c (fn_type_unification): Use explicit args in template
    	instantiation context.

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 440df1e..a39d114 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -15008,8 +15008,10 @@  fn_type_unification (tree fn,
 
       processing_template_decl += incomplete;
       input_location = DECL_SOURCE_LOCATION (fn);
+      TREE_VALUE (tinst) = explicit_targs;
       fntype = tsubst (TREE_TYPE (fn), explicit_targs,
 		       complain | tf_partial, NULL_TREE);
+      TREE_VALUE (tinst) = targs;
       input_location = loc;
       processing_template_decl -= incomplete;