Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Bug 570854 - IllegalArgumentException when using variable with type alias (using) before defining it

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 8.3.4.3 and 8.5.1.4). 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?

 

Regards

Michael Uhl


Back to the top