mangle.c (write_expression): Issue a sorry for zero-operand functional casts.
authorMark Mitchell <mark@codesourcery.com>
Sun, 18 Jul 2004 19:32:10 +0000 (19:32 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 18 Jul 2004 19:32:10 +0000 (19:32 +0000)
* mangle.c (write_expression): Issue a sorry for zero-operand
functional casts.

From-SVN: r84899

gcc/cp/ChangeLog
gcc/cp/mangle.c

index 29ef50d6fdef7a9ab9b8ebca306b026cea43a289..97da2dda020496ff9ded80bea8d2bf0499449ef7 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-18  Mark Mitchell  <mark@codesourcery.com>
+
+       * mangle.c (write_expression): Issue a sorry for zero-operand
+       functional casts.
+
 2004-07-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        PR c++/13092
index 97d4309fcf278b1fe3e20d7f86f8d0c3b697d468..211c218321d7cd9ef2a9714b405aee7269f958e6 100644 (file)
@@ -2056,7 +2056,13 @@ write_expression (tree expr)
 
        case CAST_EXPR:
          write_type (TREE_TYPE (expr));
-         write_expression (TREE_VALUE (TREE_OPERAND (expr, 0)));
+         /* There is no way to mangle a zero-operand cast like
+            "T()".  */
+         if (!TREE_OPERAND (expr, 0))
+           sorry ("zero-operand casts cannot be mangled due to a defect "
+                  "in the C++ ABI");
+         else
+           write_expression (TREE_VALUE (TREE_OPERAND (expr, 0)));
          break;
 
        case STATIC_CAST_EXPR: