On 08/01/2012 11:49 AM, Paolo Carlini wrote:
static_assert(sizeof(g<C>(0)) == 2, "Ouch");          // line 11

typedef int testg[sizeof(g<C>(0)) == 2 ? 1 : -1];      // line 13

what happens is that line 13 is mishandled:

sfinae37_red.C:13:48: error: size of array ‘testg’ is negative

However, *if I comment out line 11*, things work for line 13! If I swap
line 11 and line 13 then the declaration of testg is accepted and the
static_assert triggers.

Curious. I guess that the second time we see the call the compiler thinks it already has the candidate it needs, but I don't know why that would be. Are we not getting to type_unification_real from add_template_candidate the second time?

Jason

Reply via email to