The fix for
DDC-770 made the \Doctrine\ORM\AbstractQuery call the free method when __cloned. This is fine with an abstract query but when you clone from a Doctrine\ORM\Query it calls the free method of that class which nulls out the DQL statement. This breaks the example given in the Doctrine ORM cookbook of writing a custom walker.
This is either a bug in the documentation or a bug in Doctrine ORM.