Community
Participate
Working Groups
* The exception is thrown, because the CPPVisitor is used for plain C nodes. * I noticed that SizeofCalculator uses ICPPBasicType instead of IBasicType. Sample code: typedef int T[sizeof(int)]; Exception: java.lang.IllegalArgumentException at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.createType(CPPVisitor.java:1841) at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.createType(CPPVisitor.java:1717) at org.eclipse.cdt.internal.core.dom.parser.Value.evaluate(Value.java:475) at org.eclipse.cdt.internal.core.dom.parser.Value.create(Value.java:363) at org.eclipse.cdt.internal.core.dom.parser.c.CArrayType.getSize(CArrayType.java:132) ...
*** Bug 362574 has been marked as a duplicate of this bug. ***
Added testcase and fix.
*** cdt git genie on behalf of Markus Schorn *** Bug 362464: Sizeof computation for plain C. [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=5a62f3280d7b55fef0ac4a0cf9f5d451de1f98a8
Hi Markus, I also get this exception on the latest build of 8.0.2 (8.0.0.201111030706). Would it be possible to port the fix to 8.0.2?
(In reply to comment #4) > Hi Markus, I also get this exception on the latest build of 8.0.2 > (8.0.0.201111030706). Would it be possible to port the fix to 8.0.2? Thanks, it slipped my attention that the fix for bug 361604 also went into 8_0.
*** cdt git genie on behalf of Markus Schorn *** Bug 362464: Sizeof computation for plain C. [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=5e359e4722aee932e301cd6daf9bb076fefb6f47