Implement the equivalent of D4955 (#648)