The potential energy function of the ground electronic state of HeH + 2 is calculated at the multireference configuration interaction level of ab initio theory, using a molecular orbital basis optimized in an appropriate multiconfiguration SCF procedure. Energies of all rotational-vibrational bound states of HeH + 2 and HeD + 2 are determined variationally from a diagonalization of the full dimensional Sutcliffe-Tennyson Hamiltonian for triatomic molecules. The results obtained at the present high-accuracy level differ significantly from those of previously published calculations. They are used to assess the reliability of an adiabatic approximation in which the high-frequency H + 2 stretching vibration is separated from the remaining motions. For all bound vibrational levels of HeH + 2, good agreement between the results from the adiabatic approximation and the rigorous full dimensional calculation is obtained.