Path: utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!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: g++ 1.32 can't parse recent C++ syntax Message-ID: <8901021738.aa10570@PARIS.ICS.UCI.EDU> Date: 3 Jan 89 01:36:29 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 34 Hi, The following cryptic looking C++ code comes from page 309 of Stroustrup and Lippman's ``Pointers to Class Members in C++'' article from the USENIX C++ Conference, 1988. It fails to compile on g++ 1.32. Here's the code: ---------------------------------------- class X { public: int i; void foo ( int ) { } }; main ( int, char *argv [ ] ) { void (X::*pmfXVi2)(int) = &X::foo; } ---------------------------------------- Here are the diagnostics: ---------------------------------------- In function main (int, char **): bug.c:10: parse error before `*' ---------------------------------------- Note that if the declaration is moved to the outer scope ( i.e., outside of main() ) the compiler handles this correctly ( there seems to be a general problem correctly parsing with this type of declaration in both g++ and cfront 1.2.1. ). Doug