error.c (dump_expr, [...]): Fix.
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 9 Sep 2013 13:34:44 +0000 (13:34 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 9 Sep 2013 13:34:44 +0000 (13:34 +0000)
2013-09-09  Paolo Carlini  <paolo.carlini@oracle.com>

* error.c (dump_expr, [PSEUDO_DTOR_EXPR]): Fix.
* cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
Tweak, TREE_OPERAND (t, 1) may be null.

From-SVN: r202401

gcc/cp/ChangeLog
gcc/cp/cxx-pretty-print.c
gcc/cp/error.c

index 9ba17c8bc31ec992a802e56cbe0958b7c5b76b90..8bd332b9c51388ff3a06f2329a8af0a2389d53aa 100644 (file)
@@ -1,10 +1,16 @@
+2013-09-09  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * error.c (dump_expr, [PSEUDO_DTOR_EXPR]): Fix.
+       * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
+       Tweak, TREE_OPERAND (t, 1) may be null.
+
 2013-09-08  Caroline Tice  <cmtice@google.com>
 
        PR c++/58300
        * vtable-class-hierarchy.c (vtv_generate_init_routine):  In
        preinit case, move call to assemble_vtv_preinit_initializer to
        after call to cgraph_process_new_functions.
-       
+
 2013-09-08  Tom de Vries  <tom@codesourcery.com>
 
        PR c++/58282
index 4578a5b0b059b93f61cd11d45b528bb3ea904897..86d8b471e7f68be615efdd41f60f09bce31c61a8 100644 (file)
@@ -618,8 +618,11 @@ cxx_pretty_printer::postfix_expression (tree t)
     case PSEUDO_DTOR_EXPR:
       postfix_expression (TREE_OPERAND (t, 0));
       pp_cxx_dot (this);
-      pp_cxx_qualified_id (this, TREE_OPERAND (t, 1));
-      pp_cxx_colon_colon (this);
+      if (TREE_OPERAND (t, 1))
+       {
+         pp_cxx_qualified_id (this, TREE_OPERAND (t, 1));
+         pp_cxx_colon_colon (this);
+       }
       pp_complement (this);
       pp_cxx_unqualified_id (this, TREE_OPERAND (t, 2));
       break;
index 78c74b65e67ea98399895499bd871b3f56ef2e1e..a51984e2eb41995629044dfbd71eb0bf2287bdcc 100644 (file)
@@ -2472,12 +2472,15 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags)
       break;
 
     case PSEUDO_DTOR_EXPR:
-      dump_expr (pp, TREE_OPERAND (t, 2), flags);
+      dump_expr (pp, TREE_OPERAND (t, 0), flags);
       pp_cxx_dot (pp);
-      dump_type (pp, TREE_OPERAND (t, 0), flags);
-      pp_cxx_colon_colon (pp);
+      if (TREE_OPERAND (t, 1))
+       {
+         dump_type (pp, TREE_OPERAND (t, 1), flags);
+         pp_cxx_colon_colon (pp);
+       }
       pp_cxx_complement (pp);
-      dump_type (pp, TREE_OPERAND (t, 1), flags);
+      dump_type (pp, TREE_OPERAND (t, 2), flags);
       break;
 
     case TEMPLATE_ID_EXPR: