Fix p24939.
authorMike Stump <mrs@wrs.com>
Fri, 3 Dec 1999 03:31:44 +0000 (03:31 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Fri, 3 Dec 1999 03:31:44 +0000 (03:31 +0000)
From-SVN: r30765

gcc/cp/ChangeLog
gcc/cp/init.c
gcc/testsuite/g++.old-deja/g++.mike/s24939.C [new file with mode: 0644]

index db5dad4f19d6e16308737ecc5c1eb1dc68228e03..5e34a578cbfe2c47d4cc0ae10ef915022631e7a7 100644 (file)
@@ -1,3 +1,7 @@
+1999-12-02  Mike Stump  <mrs@wrs.com>
+
+       * init.c (perform_member_init): Handle parse errors better.
+
 1999-12-01  Mark Mitchell  <mark@codesourcery.com>
 
        * cp-tree.h (min_tree_cons): Remove.
index 639087ac39b219ed02a568287a535dc85202d25c..b0be498950b0d953045aaa5135a9b2aa5967a284 100644 (file)
@@ -144,6 +144,9 @@ perform_member_init (member, name, init, explicit)
 
   decl = build_component_ref (current_class_ref, name, NULL_TREE, explicit);
 
+  if (decl == error_mark_node)
+    return;
+
   /* Deal with this here, as we will get confused if we try to call the
      assignment op for an anonymous union.  This can happen in a
      synthesized copy constructor.  */
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/s24939.C b/gcc/testsuite/g++.old-deja/g++.mike/s24939.C
new file mode 100644 (file)
index 0000000..3ed8fd1
--- /dev/null
@@ -0,0 +1,13 @@
+// Build don't link:
+
+class A;
+
+class B {
+public:
+  B(); 
+private:
+  A a;  // ERROR - 
+};
+
+class A { };
+B::B() { }