All Squid-4+ versions have a hard GCC-5 minimal version requirement. Which should be fine for current Ubuntu.
All Squid-3 versions have a GCC-7 or lower build requirement. Optimally GCC-6 or lower, as implemented in the build dependencies for the Debian 3.5.23+ packages.
The Squid-4.x packages from Debian all integrate the upstream fix for this, as does the v4.1 package port in cosmic-proposed queue.
For the record:
All Squid-4+ versions have a hard GCC-5 minimal version requirement. Which should be fine for current Ubuntu.
All Squid-3 versions have a GCC-7 or lower build requirement. Optimally GCC-6 or lower, as implemented in the build dependencies for the Debian 3.5.23+ packages.
The Squid-4.x packages from Debian all integrate the upstream fix for this, as does the v4.1 package port in cosmic-proposed queue.