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]

C++ PATCH: Fix mangling of operators in `extern "C"'



The lazy DECL_ASSEMBLER_NAME patch broke the mangling of `extern "C"'
overloaded operators.  Fixed with the attached patch.  The test-case
is the now-revived g++.other/mangle2.C.

Tested on i686-pc-linux-gnu, applied on the branch and mainline.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2001-03-21  Mark Mitchell  <mark@codesourcery.com>

	* mangle.c (mangle_decl_string): Mangle the names of overloaded
	operators, even when they have `extern "C"' linkage.

Index: mangle.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/mangle.c,v
retrieving revision 1.28
diff -c -p -r1.28 mangle.c
*** mangle.c	2001/03/19 23:49:55	1.28
--- mangle.c	2001/03/21 17:16:33
*************** mangle_decl_string (decl)
*** 2071,2076 ****
--- 2071,2078 ----
      write_type (TREE_TYPE (decl));
    else if (/* The names of `extern "C"' functions are not mangled.  */
  	   (TREE_CODE (decl) == FUNCTION_DECL 
+ 	    /* But overloaded operator names *are* mangled.  */
+ 	    && !DECL_OVERLOADED_OPERATOR_P (decl)
  	    /* If there's no DECL_LANG_SPECIFIC, it's a function built
  	       by language-independent code, which never builds
  	       functions with C++ linkage.  */


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