Why -frelaxed-template-template-args is added back?

The change ⚙ D109496 [clang] deprecate frelaxed-template-template-args, make it on by default was reverted in Revert "[clang] deprecate frelaxed-template-template-args, make it on… · llvm/llvm-project@60a085b · GitHub. I miss:

  • Sample of the breakage
  • Discussion
  • Path moving forward

The change at the language level is expected to be not fully backward-compatible. So I was surprised by the brevity of the revert.

The breakage was what was expected for that change. See for example the last half of clang/test/SemaTemplate/deduction.cpp for a test that would be affected.

On the first attempt, before we reverted it, we tried to implement the changes as intended, that is, as a DR against all language versions.

But that breaks ROCm standard library as you can see described at ⚙ D109496 [clang] deprecate frelaxed-template-template-args, make it on by default

The problem is that even the GCC solution, which implements the change only for C++17 forward, is not viable.as well to work around this.

The other option we started exploring was to tweak the rules a little bit, so that we would not break the valid-but-reasonable code that this breaks. I think this was the original intention of the author of P0522, and what the committee was told and expected, but the author stopped participating and this fell into the cracks.

The last patch uploaded in that DR implements a tweak along these lines, which does not break clang/test/SemaTemplate/deduction.cpp. But then zygoloid, in private conversation, suggested a better approach, which I did not have the chance to try yet as I went into some really long vacations and paged out on that effort.

I am currently working on a different project which I intend to present at the conference. When that is done, I will have more open time and finishing this is at the top of my list.

Are you still working on this? Thanks!

I plan to get back to my this by mid June. Sorry that my free time has been a bit uncooperative lately.