Is there anythig incorrect when using placement new on global vars?
<p>I was playing with an idea where i can have variables in global scope but <a href="http://stackoverflow.com/questions/9344346/how-do-i-cancel-not-call-the-constructor-in-a-global-variable/9344459#comment11795868_9344459">not construct them</a>. Note that there IS a placement new being ran. However i'd like to know what is undefined or incorrect about this code</p>

<pre><code>#include &lt;new&gt;
#include &lt;cstdio&gt;
#include &lt;typeinfo&gt;

//#define AlignAs alignas(T)
#define AlignAs

template&lt;class T&gt;struct BlockOf {
    AlignAs char t[sizeof(T)];
    operator T&amp;() { return reinterpret_cast&lt;T&amp;&gt;(*this); }
    ~BlockOf(){((T*)&amp;t)-&gt;~T(); }
};
struct B{ 
    virtual void v(){} 
    ~B() { printf("B\n"); } 
};
struct A: B{ 
    A(){printf("a\n");} 
    int regularDots; 
    void v() { printf("A virtual\n"); } 
};

BlockOf&lt;A&gt; _a;
A&amp;a=_a;

void init(){
    new(&amp;a) A;
}

int main() {
    init();
    A aa;
    a.regularDots=9;
    printf("%s %s %d %d\n", 
        typeid(a).name(),
        typeid(aa).name(),
        typeid(a).hash_code()==typeid(aa).hash_code(),
        sizeof(a) == sizeof(aa)
        );
    B *b = &amp;a;
    b-&gt;v();
}
</code></pre>
