Community
Participate
Working Groups
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.
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