iranano 0 Newbie Poster

In the follwong program a class-type temporary is cast to a refrence and they changed:

struct A 
{
    int a;
    A() { a = 100; }
};
void f(A& x) { x.a = 200; };
int main()
{
    f((A&)A{});
}

No errors in Visual Studio and GCC. But is it safe to use such cast, instead of useing rvalue reference, in Standard C++?