This is the mail archive of the gcc-bugs@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]

[Bug c++/31165] [4.2/4.3 Regression] Error: symbol `an_empty_string' is already defined



------- Comment #5 from pinskia at gcc dot gnu dot org  2007-03-13 21:40 -------
A quick patch which I am testing right now:
Index: cp/call.c
===================================================================
--- cp/call.c   (revision 122871)
+++ cp/call.c   (working copy)
@@ -4671,7 +4671,7 @@
         VAR_DECL.  We can avoid the copy for constants, since they
         are never modified in place.  */
       if (!CONSTANT_CLASS_P (arg))
-       arg = copy_node (arg);
+       arg = unshare_expr (arg);
       arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL,
                                        "default argument", fn, parmnum);
       arg = convert_for_arg_passing (type, arg);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31165


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