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++/39095] [4.4 Regression] Mangling changes break ABI



------- Comment #2 from jakub at gcc dot gnu dot org  2009-02-04 13:39 -------
Just doing:
@@ -1111,12 +1111,18 @@ write_unqualified_name (const tree decl)
   else if (DECL_OVERLOADED_OPERATOR_P (decl))
     {
       operator_name_info_t *oni;
+      enum tree_code code = DECL_OVERLOADED_OPERATOR_P (decl);
+
       if (DECL_ASSIGNMENT_OPERATOR_P (decl))
         oni = assignment_operator_name_info;
       else
-        oni = operator_name_info;
+        {
+          oni = operator_name_info;
+          if (code == COMPONENT_REF)
+            code = ARROW_EXPR;
+        }

-      write_string (oni[DECL_OVERLOADED_OPERATOR_P (decl)].mangled_name);
+      write_string (oni[(int) code].mangled_name);
     }
   else if (VAR_OR_FUNCTION_DECL_P (decl) && ! TREE_PUBLIC (decl)
            && DECL_NAMESPACE_SCOPE_P (decl)
is sufficient for the mangling, but still operator. appears in dumps etc.
instead of operator->, and I guess the name -> mangled name stuff in
write_expression won't do the right thing either.  So, either the operators.def
change should be reverted and dt should use a different code from COMPONENT_REF
(or no code at all and just write_string ("dt").  Or operator-> should be
parsed and handled as operator with ARROW_EXPR code rather than COMPONENT_REF.


-- 


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


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