Semi-codeless receivers can use it anyways. The reason is that the W code has a much lower data-rate (500KHz I think).
Take the incoming signal, correlate with the aligned P code. The resulting signal will be a MHZ wide signal, bandpass to it, and square the result. The squaring wipes off the residual W code. Because you bandpass filtered before the squaring you don't get so much squaring loss. Lock the resulting carrier, and use RTK signals and long observations to resolve integer ambiguities.
For a dual frequency rx you can exploit that P(Y) is the same on both frequencies and correlate them against each other to find the ionospheric delays.
E.G.
P code 1001011010010110101010100010101
W code 00001111000000001111111100001111
And since it's modulated with the W code this would leak information. Not really sure how off base that part is, that's just a rough explanation I was told many years back.
Also, I've been wondering, how effective the old scheme with a secret military and a public code was - certainly an old GPS reciever shows up sometimes at a military surplus store. I wouldn't be surprized if enemy nations bought one of those, and extracted the secret parameters from the now quite old chips using modern technology.