After posting record earnings and setting 19 financial records during the second quarter, General Motors is warning that the U.K.'s decision to exit the European Union could slow down a fledgling recovery in that market during the second half of the year.

Yet that warning did little to cool the enthusiasm of investors, who pushed the company's shares to $32.19, more than 2 percent higher, following its second-quarter earnings report.