Change hasName() to take const std::string&, as it was taking before rL219792.