10-01-2025, 01:24 PM
The argument for 'id-expression' is that we wanted to keep the rule simple, whilst preventing i1 = s1 + s2; (a widening assignment).
We tried to enumerate the possible cases which were safe, but this got very complex, so we went to a simple case that was safe.
We will consider the rule in future to allow other safe cases, such as your example of class member access ("member-expression")
We tried to enumerate the possible cases which were safe, but this got very complex, so we went to a simple case that was safe.
We will consider the rule in future to allow other safe cases, such as your example of class member access ("member-expression")
Posted by and on behalf of
the MISRA C++ Working Group
the MISRA C++ Working Group