From 812608b90322fa2aef57c286bbf93a38010dbf5b Mon Sep 17 00:00:00 2001 From: mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 3 Dec 1999 03:31:44 +0000 Subject: [PATCH] Fix p24939. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30765 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/init.c | 3 +++ gcc/testsuite/g++.old-deja/g++.mike/s24939.C | 13 +++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.mike/s24939.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index db5dad4f19d6..5e34a578cbfe 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 639087ac39b2..b0be498950b0 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -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 index 000000000000..3ed8fd1ab199 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.mike/s24939.C @@ -0,0 +1,13 @@ +// Build don't link: + +class A; + +class B { +public: + B(); +private: + A a; // ERROR - +}; + +class A { }; +B::B() { } -- GitLab