// Creates an object of type A, named A.
A A(10);
// The compiler gets confused. A is a variable so what is obj doing after it?
A obj;
You could work around this by explicitly specify the namespace of class A.
If A is defined in the global namespace you can write ::A obj;
but probably a better solution is to avoid using the same names for variables and types in the first place.