#include <iostream>
using namespace std;
class X{
public:
X(){}
X(int){}
int test(){return 1;}
};
int main(int argc, char const *argv[]){
X x1 = X(1);
X x2(1);
X x3 = X();
X x4();
cout << x1.test();
cout << x2.test();
cout << x3.test();
cout << x4.test();
return 0;
}
X4.test() при компиляции выдает
error: request for member ‘test’ in ‘x4’, which is of non-class type ‘X()’