]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/38636 (ICE with broken ctor declaration)
authorDodji Seketeli <dodji@redhat.com>
Thu, 15 Jan 2009 13:01:36 +0000 (13:01 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Thu, 15 Jan 2009 13:01:36 +0000 (14:01 +0100)
gcc/cp/ChangeLog:
2009-01-13  Dodji Seketeli  <dodji@redhat.com>

PR c++/38636
* name-lookup.c (pushtag): Don't create members to types that are not
being created.

gcc/testsuite/ChangeLog:
2009-01-13  Dodji Seketeli  <dodji@redhat.com>

PR c++/38636
* g++.dg/parse/crash50.C: New test.

From-SVN: r143392

gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/crash50.C [new file with mode: 0644]

index da52022eea1cec624be1dfb1fe8a928162446bb4..07b9c7e49e6d09a5d8232d224a7ed03f64cd6e3e 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-15  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/38636
+       * name-lookup.c (pushtag): Don't create members to types that are not
+       being created.
+
 2009-01-14  Nick Clifton  <nickc@redhat.com>
 
        PR c++/37862
index 6dc244fccb8ba5fa18fe23ad8efc084055393843..f8d0204f0994bc22463c4306abc3803f4ef58557 100644 (file)
@@ -5109,6 +5109,9 @@ pushtag (tree name, tree type, tag_scope scope)
 
       if (b->kind == sk_class)
        {
+         if (!TYPE_BEING_DEFINED (current_class_type))
+           POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
+
          if (!PROCESSING_REAL_TEMPLATE_DECL_P ())
            /* Put this TYPE_DECL on the TYPE_FIELDS list for the
               class.  But if it's a member template class, we want
index fae2df8f3f6dc9aeb4070bff4a342d10b6a767f3..237ce656c31c835419d125d4c6dcba8d6f8dc94d 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-15  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/38636
+       * g++.dg/parse/crash50.C: New test.
+
 2009-01-14  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/38245
diff --git a/gcc/testsuite/g++.dg/parse/crash50.C b/gcc/testsuite/g++.dg/parse/crash50.C
new file mode 100644 (file)
index 0000000..711048d
--- /dev/null
@@ -0,0 +1,10 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/38636
+// { dg-do compile }
+
+struct A; // { dg-error "forward declaration of 'struct A'" }
+
+A::A(
+
+struct B; // { dg-error "expected '\\)' before ';' token|invalid use of incomplete type 'struct A'" }
+