Path: utzoo!utgpu!watmath!iuvax!cica!tut.cis.ohio-state.edu!YAHI.STANFORD.EDU!tiemann From: tiemann@YAHI.STANFORD.EDU (Michael Tiemann) Newsgroups: gnu.g++.bug Subject: g++ 1.35.0, sun3-os4; signal 11 while compiling Message-ID: <8907280436.AA28479@yahi.Stanford.EDU> Date: 28 Jul 89 04:36:09 GMT References: <8907272147.AA18508@imposter> Sender: daemon@tut.cis.ohio-state.edu Reply-To: tiemann@lurch.stanford.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 42 When I compile the following test program, I get a segmentation violation. When the structure declaration is removed from the class, the problem goes away. >>> The code: /* g++ 1.35.0, sun3-os4; signal 11 while compiling */ class ObjectTable { private: typedef struct ote_struct { int x; int y; } ObjectTableElement; ObjectTableElement ote; ObjectTableElement* index() { return &ote; } public: void setNBytes(); }; Fix: in cplus-search.c (dfs_pushdecls): for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields)) { /* Unmark so that if we are in a constructor, and then find that this field was initialized by a base initializer, we can emit an error message. */ TREE_USED (fields) = 0; if (DECL_ANON_UNION_ELEM (fields)) { dfs_pushdecls (TREE_TYPE (fields)); continue; } + if (TREE_CODE (fields) == TYPE_DECL) + continue; Michael