Building OpenCV from source: gcc and CUDA versions

CUDA lags with support for newer versions of gcc, e.g. CUDA 11 works only with gcc-9 and older. OpenCV, on the other hand can be built with newer versions of gcc. Is it necessary to restrict the gcc version when buildin OpenCV with CUDA functionality enabled?