Path: utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!MCC.COM!rfg From: rfg@MCC.COM (Ron Guilmette) Newsgroups: gnu.g++.bug Subject: segfault in g++ 1.34.1 Message-ID: <8904112047.AA17259@riunite.aca.mcc.com> Date: 11 Apr 89 20:47:25 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 41 The following piece of code, if compiled with g++ 1.34.1 using the -fall-virtual option, will cause the compiler to segfault. The problem seems to have been that cplus-typeck.c contained an incorrect test for "constructorness". A trivial patch is provided below. This patch may fix some other related bugs as well. // Options: -fall-virtual class base { public: void operator -> () (int, int, ...); }; class derived : public base { public: derived (); }; void* p; int test () { p = (void*) &derived::derived; // SEGFAULT } *** ../cplus-typeck.c Wed Mar 15 11:26:44 1989 --- cplus-typeck.c Mon Mar 27 18:30:50 1989 *************** *** 3471,3475 **** && (TREE_HAS_METHOD_CALL_OVERLOADED (DECL_CONTEXT (t)) || TREE_NEEDS_WRAPPER (DECL_CONTEXT (t))) ! && ! TREE_IS_CONSTRUCTOR (TREE_TYPE (t)))) { offset = copy_node (DECL_VINDEX (t)); --- 3471,3475 ---- && (TREE_HAS_METHOD_CALL_OVERLOADED (DECL_CONTEXT (t)) || TREE_NEEDS_WRAPPER (DECL_CONTEXT (t))) ! && ! TREE_IS_CONSTRUCTOR (t))) { offset = copy_node (DECL_VINDEX (t));