I was compiling a C++ program in Cygwin using g++ and I had a class whose constructor had no arguments. I had the lines:
MyClass myObj();
myObj.function1();
And when trying to compile it, I got the message:
error: request for member 'function1' in 'myObj', which is of non-class type 'MyClass ()()'
After a little research, I found that the fix was to change that first line to MyClass myObj;
I could swear I've done empty constructor declarations with parentheses in C++ before. Is this probably a limitation of the compiler I'm using or does the language standard really say don't use parentheses for a constructor without arguments? Thanks!