| Summary: | CDT fails to evaluate sizeof expression | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Nathan Ridge <zeratul976> |
| Component: | cdt-parser | Assignee: | Markus Schorn <mschorn.eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | Markus Schorn <mschorn.eclipse> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug |
| Version: | 8.1.0 | ||
| Target Milestone: | 8.1.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Evaluation of sizeof expressions has been implemented. There is a typo though, when the calculation is started for sizeof expressions with an unary expression as the argument. Added testcase and fix. *** cdt git genie on behalf of Markus Schorn ***
Bug 368309: Value for sizeof expression
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=8aef9f4f9d9cf3ddd82daacd6d900d6e853d7930
|
struct two { char x[2]; }; two check(...); char check(int); template <int> struct foo {}; template <> struct foo<1> { typedef int type; }; typedef foo<sizeof(check(0))>::type t; // ERROR HERE The error at the indicated line is: "Type 'foo<sizeof(check(0))>::type' could not be resolved" It seems CDT is unable to evaluate sizeof(check(0)) correctly (or at all) and therefore doesn't know to look at the specialization.