|Re: [cdt-dev] Bug 570854 - IllegalArgumentException when using variable with type alias (using) before defining it|
My 2cent (after looking at your changes and not understanding any
of it ;-) )
1) Only clone if needed
2) Comparing is best done in a method. The method can do a pointer comparison and if different a content comparison.
Coming from a C/C++ background I seriously miss the const qualifier which lead me to the approach described above.
Hello CDT team,
I have a question regarding the above mentioned bug (570854 – IllegalArgumentException when using variable with type alias (using) before defining it (eclipse.org)).
During indexing a CPPTypedef Object is cloned and therefore a reference comparison fails which leads to the IllegalargumentException. For this bug I have prepared two solutions:
The first one does not make the reference comparison but compares the members of the CPPTypedef Object (Bug 570854 - IllegalArgumentException when using variable with type alias (using) before defining it (Id19f7c99) · Gerrit Code Review (eclipse.org)).
The second one prevents the cloning of the objects in the first place. According to my analysis this cone is not needed as the code which clones the CPPTypedef Objects is added for the array treatment in C++ 11 (C++ specification 184.108.40.206 and 220.127.116.11). I have seen this through the comments in the code of CPPVisitor (line about 2322) and the JUnit test which was committed together with this change. This change is here: Bug 570854 - IllegalArgumentException when using variable with type alias (using) before defining it (I3c38ae92) · Gerrit Code Review (eclipse.org)
Which of these solutions do you consider as correct?
_______________________________________________ cdt-dev mailing list cdt-dev@xxxxxxxxxxx To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdt-dev
Back to the top