GCC 5.4.0 is the supported version for Quartus® Prime Pro Edition ver. 18.1.
Please change to GCC 5.4.0 and try it.
Please refer to the following document for Altera® HLS Compiler support environment.
Altera High Level Synthesis Compiler: User Guide
https://docs.altera.com/r/docs/683456/24.1/altera-high-level-synthesis-compiler-pro-edition-user-guide/discontinuation-of-the-intel-hls-compiler
(Search by Compiler support)
--------------------
Category: HLS
Tools: Altera® HLS Compiler
Device: Arria® 10