[clang] [clang] CTAD: implement the missing IsDeducible constraint for alias templates (PR #89358)
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 24 03:12:16 PDT 2024
hokein wrote:
> > Ah, I see. I haven't tried that, but one downside I can see is that it will make diagnostics for CTAD worse, we need to spell the type trait name in error messages when the __is_deducible trait fails.
>
> I think we should have a custom diag for that anyway "is not deducible from" is better than " `__is_deducible<>` is false"
I think this is one of the symptoms, missing the trait name in the AST dump is another symptom.
And I'm not aware of an easy way to customize a diagnostic within clang's template-constraint check mechanism. One implementation I can think of is to manual call the `DeduceTemplateArgumentsFromType` in the function overload resolution for the alias CTAD, and then emit a custom diagnostic, but it feels awkward.
https://github.com/llvm/llvm-project/pull/89358
More information about the cfe-commits
mailing list