This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH to pt.c for c++/13294


This patch fixes the "strong using" ABI such that namespace-scope explicit
class template specializations are mangled using the scope of the
specialization, rather than that of the template they specialize.

This PR turned out to be much easier to fix than I had thought when I first
looked at the problem; I expected to need to modify the mangler as well.

Tested x86_64-pc-linux-gnu, applied to trunk.  Mark, OK for 3.4.0?

2004-03-25  Jason Merrill  <jason@redhat.com>

	PR c++/13294
	* pt.c (maybe_process_partial_specialization): Remember the
	context of a specialization.

*** cp/pt.c.~1~	2004-03-25 15:27:22.000000000 -0500
--- cp/pt.c	2004-03-25 17:03:32.000000000 -0500
*************** maybe_process_partial_specialization (tr
*** 733,739 ****
  	{
  	  tree tpl_ns = decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type));
  	  if (is_associated_namespace (current_namespace, tpl_ns))
! 	    /* Same or super-using namespace.  */;
  	  else
  	    {
  	      pedwarn ("specializing `%#T' in different namespace", type);
--- 733,747 ----
  	{
  	  tree tpl_ns = decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type));
  	  if (is_associated_namespace (current_namespace, tpl_ns))
! 	    /* Same or super-using namespace.  */
! 	    {
! 	      if (DECL_NAMESPACE_SCOPE_P (CLASSTYPE_TI_TEMPLATE (type)))
! 		/* If this is a specialization of a namespace-scope class
! 		   template, remember the context of the
! 		   specialization.  */
! 		TYPE_CONTEXT (type) = DECL_CONTEXT (TYPE_NAME (type))
! 		  = FROB_CONTEXT (current_namespace);
! 	    }
  	  else
  	    {
  	      pedwarn ("specializing `%#T' in different namespace", type);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]