This patch effectively relands https://reviews.llvm.org/D66394, which back then sadly had to be reverted due to build failures. The summary given in the commit is already great, but just to summarize: Since MSVC 2017 Update 3 (or 19.11, so beyond the 19.14 minimum that clang-cl supports), two phase template parsing had been enabled by default. This patch enables two phase lookup by default in clang-cl as well, when the MSVC compatibility version is 19.11 or higher.
The patch previously had to be reverted due to issues when executed with the GCC style driver and -fno-rtti as can be seen here https://bugs.chromium.org/p/chromium/issues/detail?id=996675. https://reviews.llvm.org/D103771, which this patch depends on, implements one of the resolutions given in the report, by defining _HAS_STATIC_RTTI. For older MSVC STL versions that had a missing guard in the functional header, -fno-rtti-data may have to passed instead of -fno-rtti, as soon as std::function is instantiated, regardless of whether two phase lookup is enabled or not.
Depends on https://reviews.llvm.org/D103771