Yeah. Check a freshly generated unaltered project and report exact chip type and tool versions. Works here for STM32F429VETX and the newest STM32CubeIDE. Looks like a mixup of prprocessor definitions.
int p[8] is an array declaration and therefore, the assignment of a value (UART5->DR) to an array makes no sense and causes errors/warnings. The compiler may not be intelligent enough to give the best error message here.