Bug 13241 - [ABI] Incorrect mangling of template arguments
Summary: [ABI] Incorrect mangling of template arguments
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P1 normal
Target Milestone: 3.4.0
Assignee: Nathan Sidwell
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2003-11-30 18:01 UTC by Nathan Sidwell
Modified: 2003-12-15 17:57 UTC (History)
1 user (show)

See Also:
Host: -
Target: -
Build: -
Known to work:
Known to fail:
Last reconfirmed: 2003-11-30 19:11:40


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Sidwell 2003-11-30 18:01:15 UTC
extern "C" void Foo ();
namespace NMS 
{
  extern "C" int V;
}

template <void (*)()> struct S {};
template <int *> struct T {};

void f (S<Foo>){} // should be _Z1f1SIXadL_Z3FooEEE

void g (T<&NMS::V>){} // should be _Z1g1TIXadL_Z1VEEE
Comment 1 Andrew Pinski 2003-11-30 19:11:40 UTC
Confirmed.
Comment 2 Nathan Sidwell 2003-12-15 11:53:18 UTC
2003-12-15  Nathan Sidwell  <nathan@codesourcery.com>

 	PR c++/13241
	C++ ABI change. Mangling of symbols in expressions.
	* mangle.c (write_mangled_name): Add top_level flag. Rework for
	nested and unnested mangling. Deal with abi version 1 and version
	2 differences.
	(write_expression): Adjust write_mangled_name call.
	(mangle_decl_string): Use write_mangled_name for all non-type decls.
Comment 3 GCC Commits 2003-12-15 11:57:34 UTC
Subject: Bug 13241

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	nathan@gcc.gnu.org	2003-12-15 11:57:30

Modified files:
	gcc/cp         : ChangeLog mangle.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/abi: mangle18-1.C mangle18-2.C 

Log message:
	cp:
	PR c++/13241
	C++ ABI change. Mangling of symbols in expressions.
	* mangle.c (write_mangled_name): Add top_level flag. Rework for
	nested and unnested mangling. Deal with abi version 1 and version
	2 differences.
	(write_expression): Adjust write_mangled_name call.
	(mangle_decl_string): Use write_mangled_name for all non-type decls.
	testsuite:
	PR c++/13241
	* g++.dg/abi/mangle18-1.C: New test.
	* g++.dg/abi/mangle18-2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3800&r2=1.3801
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/mangle.c.diff?cvsroot=gcc&r1=1.91&r2=1.92
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3253&r2=1.3254
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/abi/mangle18-1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/abi/mangle18-2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 4 The gcc-bugs mailing list 2003-12-15 17:57:52 UTC
Fixed for 3.4.