There is this code:
class A; template void fun() { A a; } class A { public: A() { } }; int main() { fun(); return
Clang is correct, as far as I know. At your function fun, you do not know the size of A, and since your allocating an A, you need to know it's size. In my opinion, gcc is way to forgiving here.