I fully agree that while creating a class instance via a default constructor, we do not use parenthesis, i.i., we create an instance of class X as follows :
X obj ;
But what I am confused about is this : what happens when we give the following
X obj() ;
This statement does not give a compile-time error.
This statement does not call the default constructor of the class for
obj either.
After this statement, a class member can not be accessed on
obj - compiler says that
request for member in ‘obj’, which is of non-class type ‘X()’.
So what is actually happening at this statement if the object is not being created.