This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: GCC-2.95 misparses certain trivial code
- To: Richard dot Kreckel at Uni-Mainz dot DE
- Subject: Re: GCC-2.95 misparses certain trivial code
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Fri, 13 Aug 1999 20:35:46 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- References: <Pine.LNX.3.96.990813170533.14699A-100000@higgs.physik.uni-mainz.de>
> bar(foo(1,2)).print(cout);
Thanks for your bug report. This is a known bug; g++ thinks this is a
variable declaration; as in
bar foo(1,2);
Yes, you can have parentheses around the variable in C++. Then, when
it sees the dot, it is confused.
The work-around is to add another pair of parentheses:
(bar(foo(1,2))).print(cout);
The problem should disappear when the parser rewrite happens.
Regards,
Martin