The above code contains a typo. The parameter type of the second copy constructor is meant to be B not A