You are misinterpreting the manual, the section on the C++ interface for rationals starts:
In all the following constructors, if a fraction is given then it should be in canonical form, or if not then `mpq_class::canonicalize' called.
That means that if you pass in a fraction that can be parsed, but is not in canonical form, then you must call canonicalize
on it.
If the string is not a valid rational, an `std::invalid_argument' exception is thrown.
refers to the case that the string could not be parsed at all.
Arguably, the documentation could be clearer on that.