This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GCC-2.95 misparses certain trivial code


>     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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]