Patchwork C++/libiberty PATCH for many mangling fixes (6057, 48051, 50855, 51322 and more)

login
register
mail settings
Submitter Jason Merrill
Date March 4, 2012, 12:56 a.m.
Message ID <4F52BDA3.7050006@redhat.com>
Download mbox | patch
Permalink /patch/144475/
State New
Headers show

Comments

Jason Merrill - March 4, 2012, 12:56 a.m.
And here's a hunk I held back from that patch to be conservative; 
applying now that we're in stage 1.  It should have no effect, but is 
more consistent with other uses.

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

Patch

commit ed1e0f5a5dc43e87cfddbdca9adffd72e8c4719e
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jan 11 14:40:56 2012 -0500

    	* mangle.c (write_nested_name): Use decl_mangling_context.
    	(write_prefix, write_template_prefix): Likewise.

diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 04f4344..1379e3b 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -942,7 +942,7 @@  write_nested_name (const tree decl)
 	}
       else
 	{
-	  write_prefix (CP_DECL_CONTEXT (decl));
+	  write_prefix (decl_mangling_context (decl));
 	  write_unqualified_name (decl);
 	}
     }
@@ -1030,7 +1030,7 @@  write_prefix (const tree node)
 	}
       else
 	{
-	  write_prefix (CP_DECL_CONTEXT (decl));
+	  write_prefix (decl_mangling_context (decl));
 	  write_unqualified_name (decl);
 	}
     }
@@ -1060,7 +1060,7 @@  write_template_prefix (const tree node)
 {
   tree decl = DECL_P (node) ? node : TYPE_NAME (node);
   tree type = DECL_P (node) ? TREE_TYPE (node) : node;
-  tree context = CP_DECL_CONTEXT (decl);
+  tree context = decl_mangling_context (decl);
   tree template_info;
   tree templ;
   tree substitution;