The 46-year-old, who is expecting his first kid with wife Susan in February, talked about the baby's gender in an appearance on last night's The Tonight Show with Jay Leno, after insisting that he isn't allowed to spill the beans.
He told the US talk show host Jay: 'I am not permitted to discuss it. I keep dropping the ball everywhere - [Susan] says, 'Don't tell your cousins' and then I tell them.'
The Sherlock Holmes star added: 'I can't say a word,' before then blurting out: 'We're having a boy,' and covering his face in pretend shame.
The star, who is already dad to 18-year-old son Indio from his previous marriage to Deborah Falconer, has been married to Susan for six years.