https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67961
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- The diagnostic is correct. Trying to pass uint32_t to a function taking size_t causes a conversion, creating a temporary (i.e. rvalue) size_t, but a non-const reference cannot bind to a temporary.