TL;DR: People make better decisions about some kinds of things — but worse decisions about other kinds of things‚ when they have a strong urge to urinate.
There are two pieces of research, one confirming, and the other denying benefits to cognition in relation to bladder control. The effect is known as the (I kid you not!) spillover effect.
The theory is that the impulse control exertion to avoid peeing can "spill over" to other domains and make people less prone to emotional decisions.
One landmark paper is "Inhibitory Spillover: Increased Urination Urgency Facilitates Impulse Control in Unrelated Domains" which apparently found benefits:
Visceral states are known to have a (detrimental) impact on our ability to exert self-control. In the current research, we investigate the impact of a visceral factor associated with inhibition, rather than with approach: bladder control. We argue that inhibitory signals are not domain specific, but can spill over to unrelated domains, resulting in increased impulse control in the behavioral domain.
The other masterpiece is "The effect of acute increase in urge to void on cognitive function in healthy adults" which instead found negative effects:
The magnitude of decline in cognitive function associated with an extreme urge to void was as large and equivalent or greater than the cognitive deterioration observed for conditions known to be associated with increased accident risk.
Conclusion: both papers won the 2011 IgNobel awards for Medicine :-)
MEDICINE PRIZE: Mirjam Tuk (of THE NETHERLANDS and the UK), Debra Trampe (of THE NETHERLANDS) and Luk Warlop (of BELGIUM). and jointly to Matthew Lewis, Peter Snyder and Robert Feldman (of the USA), Robert Pietrzak, David Darby, and Paul Maruff (of AUSTRALIA) for demonstrating that people make better decisions about some kinds of things — but worse decisions about other kinds of things‚ when they have a strong urge to urinate.