-
https://cpp2.godbolt.org/z/av3ech559
It can be a problem if "threat warnings as error" enabled, in case of mixed cpp1/cpp2. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
This comment has been hidden.
This comment has been hidden.
-
Hm, looks this cpp2 valid currently
prints 0,1,1,0,1,1 |
Beta Was this translation helpful? Give feedback.
-
You're right. So only |
Beta Was this translation helpful? Give feedback.
-
So this is a non-bug (much less a suggestion). |
Beta Was this translation helpful? Give feedback.
-
I should be clearer, cppfront add extra parens. So |
Beta Was this translation helpful? Give feedback.
-
It's not extra. It's the same you write. |
Beta Was this translation helpful? Give feedback.
You're right.
It's only
if a = b
that's rejected.if (a = b)
isn't.Because the grammar is
'if' logical-or-expression
.So only
if (a == b)
don't need the redundant parentheses lowered to Cpp1 to avoid warnings.Or maybe it's good that they're lowered to Cpp1 as-is,
because it means, "hey, you used redundant parentheses in Cpp2!"