+2006-06-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27640
+ * pt.c (instantiate_template): Set processing_template_decl to
+ zero while performing substitutions.
+
2006-06-14 Mark Mitchell <mark@codesourcery.com>
PR c++/27665
tree fndecl;
tree gen_tmpl;
tree spec;
+ HOST_WIDE_INT saved_processing_template_decl;
if (tmpl == error_mark_node)
return error_mark_node;
deferring all checks until we have the FUNCTION_DECL. */
push_deferring_access_checks (dk_deferred);
- /* Substitute template parameters. */
+ /* Although PROCESSING_TEMPLATE_DECL may be true at this point
+ (because, for example, we have encountered a non-dependent
+ function call in the body of a template function must determine
+ which of several overloaded functions will be called), within the
+ instantiation itself we are not processing a template. */
+ saved_processing_template_decl = processing_template_decl;
+ processing_template_decl = 0;
+ /* Substitute template parameters to obtain the specialization. */
fndecl = tsubst (DECL_TEMPLATE_RESULT (gen_tmpl),
targ_ptr, complain, gen_tmpl);
+ processing_template_decl = saved_processing_template_decl;
if (fndecl == error_mark_node)
return error_mark_node;
+2006-06-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/27640
+ * g++.dg/template/ctor7.C: New test.
+
2006-06-15 Janis Johnson <janis187@us.ibm.com>
* gcc.dg/vmx/pr27842.c: Remove dg-do directive; use default.
--- /dev/null
+// PR c++/27640
+
+template < class T > struct refcounted :
+virtual T
+{
+ template < class A1 > refcounted (const A1 & a1) : T () { }
+};
+struct nfsserv {};
+template < class T >
+void
+sfsserver_cache_alloc (int *ns)
+{
+ new refcounted < nfsserv > (*ns);
+}
+void
+usage ()
+{
+ sfsserver_cache_alloc < int > ( 0);
+}