GCC 7.3 cannot build 16.x releases.
In file included from /tmp/llvm-16/llvm/lib/Transforms/IPO/AttributorAttributes.cpp:14:0: /tmp/llvm-16/llvm/include/llvm/Transforms/IPO/Attributor.h:1137:32: error: duplicate initialization of ‘llvm::AnalysisGetter::HasLegacyWrapper<Analysis, std::void_t<typename Analysis::Lega cyWrapper> >’ constexpr bool AnalysisGetter::HasLegacyWrapper< ^~~~~~~~~~~~~~~~~ Analysis, std::void_t<typename Analysis::LegacyWrapper>> = true; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/llvm-16/llvm/include/llvm/Transforms/IPO/Attributor.h:1137:32: error: got 1 template parameters for ‘constexpr const bool llvm::AnalysisGetter::HasLegacyWrapper< <template-parameter-1 -1>, <template-parameter-1-2> >’ /tmp/llvm-16/llvm/include/llvm/Transforms/IPO/Attributor.h:1137:32: error: but 2 required
The 17.x and main branches have more failures, e.g.
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp: `error: cannot decompose class type ‘std::pair<llvm::Value*, const llvm::SCEV*>’: ...`
We probably should just give up 7.1 and say that GCC<=7.3 is unsupported.
There is evidence that GCC 7.4 works.
I have verified that GCC 7.5 is able to build check-{llvm,clang,clang-tools,lldb,lld,polly,mlir,bolt},
but not flang due to at least flang/Common/enum-class.h and a <charconv> in a unittest.
Link: https://discourse.llvm.org/t/require-gcc-7-5-as-gcc-7-3-cannot-build-llvm/72310