OSDN Git Service

cp:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jun 2005 08:23:01 +0000 (08:23 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jun 2005 08:23:01 +0000 (08:23 +0000)
PR c++/20678
* error.c (dump_expr) <COMPONENT_REF case>: Check DECL_NAME is not
null.
testsuite:
PR c++/20678
* g++.dg/other/crash-4.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100972 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/crash-4.C [new file with mode: 0644]

index 44281fb..8a24049 100644 (file)
@@ -1,5 +1,9 @@
 2005-06-15  Nathan Sidwell  <nathan@codesourcery.com>
 
 2005-06-15  Nathan Sidwell  <nathan@codesourcery.com>
 
+       PR c++/20678
+       * error.c (dump_expr) <COMPONENT_REF case>: Check DECL_NAME is not
+       null.
+
        * Make-lang.in: Reformat some long lines.
        (gt-cp-rtti.h): New target.
        (cp/rtti.o): Add dependency.
        * Make-lang.in: Reformat some long lines.
        (gt-cp-rtti.h): New target.
        (cp/rtti.o): Add dependency.
index c247c97..3d202d6 100644 (file)
@@ -1489,7 +1489,8 @@ dump_expr (tree t, int flags)
          {
            ob = TREE_OPERAND (ob, 0);
            if (TREE_CODE (ob) != PARM_DECL
          {
            ob = TREE_OPERAND (ob, 0);
            if (TREE_CODE (ob) != PARM_DECL
-               || strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this"))
+               || (DECL_NAME (ob)
+                   && strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this")))
              {
                dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
                pp_cxx_arrow (cxx_pp);
              {
                dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
                pp_cxx_arrow (cxx_pp);
index 9b38bcd..216b331 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-15  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/20678
+       * g++.dg/other/crash-4.C: New.
+
 2005-06-14  Devang Patel  <dpatel@apple.com>
 
        * gcc.dg/vect/vect-ifcvt-1.c: Remove.
 2005-06-14  Devang Patel  <dpatel@apple.com>
 
        * gcc.dg/vect/vect-ifcvt-1.c: Remove.
diff --git a/gcc/testsuite/g++.dg/other/crash-4.C b/gcc/testsuite/g++.dg/other/crash-4.C
new file mode 100644 (file)
index 0000000..35f23e8
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Jun 2005 <nathan@codesourcery.com>
+
+// PR 20678: ICE on error message
+// Origin:  Andrew Pinski pinskia@gcc.gnu.org
+
+struct a
+{
+  a(const a&);
+};
+struct b
+{ // { dg-error "cannot bind packed field" }
+  a aa __attribute__((packed));
+};
+struct c
+{
+  b bb;
+  c(const b& __a): bb(__a) {} // { dg-error "synthesized" }
+};