Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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.

Best regards

Jantje


Op 25/02/2021 om 10:25 schreef Michael Uhl (CTR) via cdt-dev:

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


_______________________________________________
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