Hello,

FWIW I think Clang made a mistake in bending semantics in a way that is clearly
misaligned with the general design of C and C++, where a language-native, so to
speak, solution was available: introduce a scope for the local variables to
indicate that they cannot escape to the intended tailcall:

void foo(int v)
{
  {
    int a;
    capture(&a);
  }
  tailcall(v); // this cannot refer to 'a', even though it escaped earlier
}

I think this would be easily teachable to users who need [[tailcall]].

I wonder if Clang folks would be open to a dialogue about undoing this
misdesign. I'd rather not see it propagated into GCC.

Thanks.
Alexander

Reply via email to