Path: utzoo!telly!ddsw1!mcdchg!rutgers!mailrus!tut.cis.ohio-state.edu!PARIS.ICS.UCI.EDU!schmidt%crimee.ics.uci.edu From: schmidt%crimee.ics.uci.edu@PARIS.ICS.UCI.EDU ("Douglas C. Schmidt") Newsgroups: gnu.g++.bug Subject: Bug report, and FIX! Message-ID: <8901190235.aa27082@PARIS.ICS.UCI.EDU> Date: 19 Jan 89 10:27:30 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 54 Hi, There is currently a bug in the g++ 1.32 cplus-parse.y file. It causes a segmentation fault with the following construct: ---------------------------------------- main () { int j = ({1;}); } ---------------------------------------- I've found the problem with this, and included the patches for cplus-parse.y below. Doug ---------------------------------------- *** cplus-parse.y.~1~ Thu Jan 19 02:24:22 1989 --- cplus-parse.y Thu Jan 19 02:21:14 1989 *************** *** 641,647 **** compstmt ')' { if (pedantic) warning ("ANSI C forbids braced-groups within expressions"); ! expand_end_stmt_expr ($2); } | primary '(' exprlist ')' { $$ = build_x_function_call ($1, $3, current_class_decl); } | primary '[' expr ']' --- 641,647 ---- compstmt ')' { if (pedantic) warning ("ANSI C forbids braced-groups within expressions"); ! $$ = expand_end_stmt_expr ($2); } | primary '(' exprlist ')' { $$ = build_x_function_call ($1, $3, current_class_decl); } | primary '[' expr ']' *************** *** 953,959 **** compstmt ')' { if (pedantic) warning ("ANSI C forbids braced-groups within expressions"); ! expand_end_stmt_expr ($2); } | primary_no_id '(' exprlist ')' { $$ = build_x_function_call ($1, $3, current_class_decl); } | primary_no_id '[' expr ']' --- 953,959 ---- compstmt ')' { if (pedantic) warning ("ANSI C forbids braced-groups within expressions"); ! $$ = expand_end_stmt_expr ($2); } | primary_no_id '(' exprlist ')' { $$ = build_x_function_call ($1, $3, current_class_decl); } | primary_no_id '[' expr ']'