Itanium ABI updated regarding returning non-trivially moveable types

This is relevant to https://bugs.llvm.org//show_bug.cgi?id=28593.

See https://github.com/itanium-cxx-abi/cxx-abi/commit/eacbae1ebd0da58b25ddb57f5abf43efe6ab7cad.

This means that clang does the wrong thing according to the ABI as well as the C++ standard for this program:

#include <stdio.h>

struct S {
int i;
S(S*& p) { printf(“S(): %p\n”, this); p = this; }
S(S const&) = delete;
};

S get_s(S*& p) { return S(p); }

int main() {
S* p;
S s = get_s(p);
printf(" &s: %p\n", &s);
printf(" p: %p\n", p);
printf("%s\n", &s == p ? “same” : “different”);
}

GCC prints “same”. Clang prints “different”. I’m actually not sure if that pointer comparison is defined behaviour or not, but I don’t think it matters here.