Important: New toolchain requirements to build LLVM will (most likely) be landing within a week. Prepare your buildbots

Hi!

It looks like the toolchain shipped as Apple Clang 9.3 doesn’t have full support for C++17 features, particularly std::variant and std::optional (see Compiler support for C++17 - cppreference.com, it claims support for those comes with 10.0.0).

ATM, LLVM already accumulated usage of std::variant in its various components (TableGen, DenseMap, CodeGen, flang, pseudo, MLIR) as none of the buildbots seem to be testing this configuration.

I was reading RFC: Increasing the GCC and Clang requirements to support C++17 in LLVM - #10 by reinterpretcast, couldn’t see any specific justifications neither there or here about choosing apple clang 9.0.3. Also only guidance I can see for which c++17 features to use is at C++ 17 in LLVM code base! - #4 by tobiashieta, which doesn’t really mention what those are. Apparently variant and optional needs to be excluded, at the very least, which seems very unfortunate.

Any chance we can revisit this decision and bump minimum apple clang toolchain requirement to 10.0.0, be more specific about the standard library requirements in Getting Started with the LLVM System — LLVM 16.0.0git documentation or have a specific list of allowed c++17 features (and buildbots/checks enforcing them)?

This was brought up by @tschuett in ⚙ D135953 [IncludeCleaner] Introduce decl to location mapping.