M40 is the only double star in Messier's catalog. Observations by the Gaia mission show it to be an optical double, that is the stars are simply lined up in our line of sight and not gravitationally bound together as a binary.
https://octodon.social/media/8xwpvgo1fDwYi8_0eAA