This comes from [clang] Implement CTAD for type alias template. by hokein · Pull Request #77890 · llvm/llvm-project · GitHub, but moving discussion here as discussed in the Clang WG meeting.
I’m implementing a missing C++20 CTAD feature in clang. The implementation needs further iterations before it’s production-ready. Aiming for a complete bulletproof version in one patch doesn’t work in practice: increases load on reviewers, makes it difficult to split work, and increases the risk of scope creep and substantial merge conflicts. And a large patch is still likely to have bugs.
Traditionally clang does not markl/guard incomplete features of this size, and this has caused problems for consumers of Clang in the past. To mitigate potential risks for users, I’m considering adding a temporary cc1 flag to control access to this feature.
Some have suggested that features need only be stable on release branches, but this isn’t always a great solution. Not all users consume from these branches, and the developer policy quality guidelines apply equally to HEAD. At Google we release clang frequently, 1-2 weeks behind HEAD. These releases get a lot of real-world testing, and we believe benefit the community substantially by uncovering bugs early. Checking an unstable feature without a safeguard means it will be immediately used (Hyrum’s law) and we need to revert in case of bugs (often including crash-on-invalid). For features known to be unfinished, this is unnecessary churn. A temporary flag is useful to both upstream and downstream, but we are open to other options.
We understand the maintenance burden of a temporary flag, we will be responsible for maintaining this flag. The flag will be removed once the feature is stable (ETA: before the next clang 19 release). I believe a cc1-only flag with a name like -funstable-ctad-alias is something we can safely remove, rather than maintain forever.
What do people think? cc @cor3ntin @AaronBallman