Parse error on functor wrapped with paranthesis
Wei Qin
wqin@EE.Princeton.EDU
Wed Aug 13 02:02:00 GMT 2003
I found it. It is likely a variant of the known bug documented at
http://gcc.gnu.org/bugs.html#parsing
I need the paranthesis since my C++ code is synthesized from another
language. Having paranthesis ensures that operator precedence is preserved
during the translation. I will have to work around with things like
(0, std::less<int>()(10,20)).
Wei
On Tue, 12 Aug 2003, Wei Qin wrote:
>
> Hi,
> I met a problem compiling the code below
>
> #include <algorithm>
>
> ...
> bool x = (std::less<int>()(10,20));
>
>
> On this line, g++ 3.2 generates an error message of
> 'parse error before numeric constant'. Without paranthesis, it is fine.
> Is this a bug?
>
> thanks for reading,
>
> Wei
>
>
More information about the Gcc-help
mailing list