pcg@aber-cs.UUCP (Piercarlo Grandi) (02/10/90)
In article <9002071710.aa07537@ICS.UCI.EDU> rfg@ICS.UCI.EDU writes: // The problem seems to be that g++ is forgetting about the implicitly // generated copy constructor c0::c0(c0&). I think the problem has nothing to do with semantics... // Cfront 2.0 does not generate an error for this code. class c0 { int field_0; }; class c0 global_object_1; class c0 global_object_2 (global_object_1); /* gets erroneous error */ ...but that the LR(1) parser cannot say whether this is an initialized object declaration or a function declaration. It is documented in the "known limitations" section, if I remember well. Cfromt gets it right because it uses heuristics or backtracking or more context or other less agreeable technology. By the way: somebody posted that he has written a C++/C yacc grammar that solves virtually all ambiguities (it can parse in C++ old style C headers), as long as you know at parse time whether an identifier is a typedef name or not. Is MDT interested in exploring the acquisition of this grammar? -- Piercarlo "Peter" Grandi | ARPA: pcg%cs.aber.ac.uk@nsfnet-relay.ac.uk Dept of CS, UCW Aberystwyth | UUCP: ...!mcvax!ukc!aber-cs!pcg Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk