Let's say that we're flying VFR over the top of Class D airspace at 3,000 feet. The Class D extends up to 2,900 feet - we're above it, but just barely with a 100' buffer.
We're also talking to approach control for VFR flight following. Approach has given us the QNH for their nearby Class C airport, say 29.90", which we've dutifully and correctly set into our altimeter's Kollsman window.
However, it turns out there's a strong pressure gradient today. The QNH at the Class D airport underneath us is 29.80". According to that pressure setting, our altimeter would read 100 feet lower - placing us within the upper bounds of their airspace.
In a situation like this, which pressure setting actually defines the upper boundary for the Class D airspace? Would this aircraft have inadvertently busted the Class D airspace?
(One one hand, everyone within the Class D would be using the QNH reported by the local ATIS, and would expect nearby aircraft to be participating with the Class D tower. On the other, approach control would expect you using their given altimeter setting in order to comply with cruising altitudes and for vertical separation. The only rule I can find is FAR 91.121, which just requires using an altimeter setting within 100 nautical miles.)