I am not asking about the logic of such a call, rather I'm interested in a difference of support b/w Visual C++ and GCC / Clang. Visual C++ will not allow a new instance of an object to be used as the parameter for its own copy constructor. GCC and Clang allow this. Considering that 'int i = i;' is allowed, I'm wondering whether Visual C++ has a bug.
class test {
private:
test() {}
public:
test(const test& t) {}
};
int main(void) {
int i = i;
test t(t); -- this line gives an error in Visual C++
return 0;
}