I've used WD40 to clean the chain - seems to work as well as anything else I've used, but I follow it with Chain Wax (after wiping the chain clean). I've heard/read so many admonitions about using WD40 alone that I'm reluctant to do so - the Service Manager at my local Honda dealer was the most adamant about not letting WD40 touch the chain! I've also heard from other sources that WD40 is harmless to O and X ring chains, which I believe is true. My biggest concern is whether or not it provides sufficient lubrication for the exposed parts of the chain and sprockets. It would sure be a lot less expense (time and money) to just use 1 product to clean (mostly just accumulated dust) & lube the chain - and WD40 is so readily available and less expensive than most any other chain specific product.
At least one chain manufacturer recommends WD40 for displacing water on an x-ring chain so I can't believe it "hurts" the chain or o / x rings. Water displacing is the prime purpose of WD40 anyway. As far as lubricating the exposed parts of chains and sprockets, I am questioning the need as there is no relative motion between them. The motion is in the rollers which are internally greased. What the exterior needs is a cleaner / rust preventative. Wax is not much of a lubricant either. I use Renaissance Wax on high value blued firearms instead of oil as a rust preventative. I put lube where I need lube, but I don't need it on the external surface that doesn't have relative motion to other parts. When I have seen sprockets die, the teeth are not worn so much as they are pulled forward. I would change chains and sprockets together, so I am not so sure why it would matter. I know people who get 15-20,000 miles out of an x-ring chain with nothing but WD40 and I generally get 15-20,000 miles out of one with my careful regimen of cleaner/degreaser, dry it, warm it up, apply chain wax, wait 20-30 minutes for it to dry. I have been on trips with such a friend. When we get to the motel he wets a rag with WD40 and spins the rear tire holding the rag wrapped around the chain. Then he goes in and pops the tab on a beer. He doesn't buy chains any more often than I do.
I am just questioning my own process here. It would only cost the price of a chain to find out which is about to overcome my reluctance to try it.