[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Tue May 14 01:11:16 PDT 2024


sam-mccall wrote:

The immediate deprecation causes a few issues:

- mechanical: we build with `-Wall -Werror -Wno-deprecated-declarations -Wno-deprecated-other-stuff` in part to catch driver misuse and fix it early. However this warning is not actionable, so now we need `-Wno-deprecated` which has undesirable effects and is also just changing unreasonably many things at once.
- mixed messages: there was a lot of confusion that this commit made the flag both required and deprecated. This isn't usual practice.
- scary with unclear expectations: deprecation warning means we need to migrate now, but we can't (not our code, authors probably won't take this seriously until clang-19). So our toolchain could break any day now?
- compatibility: there's no non-deprecated argv that results in the same behavior before and after this commit. What is a build system supposed to do if it can't version-lock clang? (Google actually *does* version-lock clang, this is only tangentially relevant to us because of clang-tidy, clangd etc. More relevant to others)
 
I think a good alternative would be: fix behavior + change default now in clang-19 cycle, deprecate `-fno-relaxed` flag in clang-20 cycle, remove `-fno-relaxed` and deprecate `-frelaxed` in clang-21 cycle. I believe this is more in line with what we've done in the past. Removing `-fno-relaxed` support is the real win here, and as this breaks deployed code doing that before clang-21 is probably unrealistic anyway.

---

(I forgot to mention earlier - a consequence of the crashes is that clang-tidy pipelines, clangd etc started crashing, which was disruptive to a lot of people. For clang per se it's not terribly severe to crash after emitting diagnostics, but other tools need to be able to consume real-world code and keep running, whether it's valid or not. In that sense this was more severe than a usual crash-on-invalid)

https://github.com/llvm/llvm-project/pull/89807


More information about the cfe-commits mailing list