I'm back from my television excursion now ... and wow a lot has transpired.
No, I'm pretty sure the overflow is in base hammers, so it doesn't matter if you get production bonuses on the building you whip. It's only to avoid the 50% penalty (which gives you 20 hammers not 15 as stated earlier).
The overflow is in base hammers, but the production bonus to the first build (the one whipped) affects how many base hammers are used -- and thus how many hammers are overflowed.
For example, where a non-Aggressive leader would expend 12 hammers and overflow only 18

on a Barracks @ -12 hammers, an Aggressive leader would expend just 6 and overflow 24

on that same Barracks @ -12 hammers.
So the first build's production bonus allows you to shave a few turns
and overflow just as much or more (versus a non-boosted leader).
The bonus is small, but turns are turns, ya know?
Otherwise, whipping a unit is just as good as whipping a building.
IOW: Apply the

to whatever unit/building is going to result in the fewest base

used (and thus the one with the highest production bonus or fewest

needed to finish).
Uh-oh...
Actually, I'm not contradicting KMad, I'm contradicting the Otaku
You sonofa. .. .. .. .. .

j/k
Whipping does take into account production bonuses, overflow does not.
If you're industrious and overflow a unit to a forge you'll get the bonus on the overflow. If you overflow a forge to a unit you will not get the forge bonus for the unit. Make sense?
Now it sounds like you're contradicting yourself.

Or maybe it's too late for me to be trying to count, huh?
EDIT: It's taken me an hour, but now I understand what you meant ... we were saying the same thing in different ways. The moral of both our stories is to calculate overflow based on the
raw production -- not the bonus-modified production.
- The only hammers that do not get production bonuses are those coming from a Great Engineer's rush.
- Overflow gets whatever production bonuses are applicable to the build[ing] the overflow is being applied to.
- If a Forge is in place, regardless of how that Forge was built, hammers receive a +25% bonus from it.
For example, if you whip a non-Industrious Forge at -1

, 29 raw hammers overflow. Those 29 raw overflow hammers are applied to the next build as 29 * 1.25 = 36 modified

.