In this work the optical properties of natural (IIa) and p-type semiconducting (IIb) diamonds were studied in the neighborhood of the first direct gap, at about 7 eV, whose energy position, nature, and origin are still under debate. The complex dielectric function \ensuremath{\epsilon}(\ensuremath{\omega}) of these materials was measured by means of spectroscopic ellipsometry combined with synchrotron radiation in the energy region 5--9.5 eV and the temperature range 80--800 K. The experimental results and the origin of the first direct gap of diamond were discussed with use of band-structure and dielectric-function calculations, as obtained from the linear-muffin-tin-orbitals method. The structure in the dielectric function related to the first direct gap of diamond was found to be a contribution not only of 3\ensuremath{\rightarrow}5 and 4\ensuremath{\rightarrow}5 transitions, as in III-V materials, but also of 3\ensuremath{\rightarrow}6 and 4\ensuremath{\rightarrow}6 transitions. Furthermore, the obtained \ensuremath{\epsilon}(\ensuremath{\omega}) spectra were analyzed with standard analytic line shapes and the observed differences between the two diamond types in the temperature dependence of the energy position and broadening were discussed and compared with experimental and theoretical results on other III-V and group-IV materials. A temperature coefficient of 3.1(5)\ifmmode\times\else\texttimes\fi{}${10}^{\mathrm{\ensuremath{-}}4}$ and 2.3(5)\ifmmode\times\else\texttimes\fi{}${10}^{\mathrm{\ensuremath{-}}4}$ eV/K was found for the first direct gap of diamonds IIa and IIb, respectively (values larger than 5\ifmmode\times\else\texttimes\fi{}${10}^{\mathrm{\ensuremath{-}}4}$ eV/K reported for the other group-IV and III-V materials), which is in quite good agreement with recent calculated results. Finally, the presence of a surface oxide layer and the way it affects the dielectric function of the material, as well as the possible occurrence of a secondary reflectivity peak reported in the literature, were also commented on and discussed.