#include <new>
using namespace std;
void f(void*)
{}
struct A
{};
int main()
{
A a;
f((a.~A(), &a)); // OK
new (&a) A(); // OK
new ((a.~A(), &a)) A(); // error C2059: syntax error : 'type'
}
I think (a.~A(), &a) is a valid expression which can be evaluated to a pointer value, so it should be accepted as the placement argument, why is the result not so?
My compiler is VC++ 2013 RC. Is this a compiler bug?
Update:
I have summitted a bug to connect.microsoft.com