[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug report: Concat operator parsing error.
- From: eugeny gladkih <john@...>
- Date: Wed, 3 Nov 2021 02:36:01 +0300
> On 2 Nov 2021, at 16:29, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>
>> (To go off on a tangent: [...]
>
> As a somewhat similar example, but more common and still "problematic":
> In C, a+++++b could be correctly parsed as a++ + ++b, but it's not.
> Following the "longest" rule in the scanner, it's parsed as a++ ++ +b,
> which raises an error, as one cannot increment 'a++'.
no, it’s parsed as "a++ ++ +b”
> cat 1.cxx
int a=0, b=0;
int c = a+++++b;
> clang++ -std=c++17 1.cxx -c
1.cxx:2:12: error: expression is not assignable
int c = a+++++b;
~~~^
1 error generated.
> cat 2.cxx
int a=0, b=0;
int c = a++ ++ +b;
> clang++ -std=c++17 2.cxx -c
2.cxx:2:13: error: expression is not assignable
int c = a++ ++ +b;
~~~ ^
1 error generated.
apple clang V13
--
Yours sincerely, Eugeny.
+33 6 38 52 27 93