[clang] Backport: use canonical arguments for checking function template constraints
Backport from #186889
This is a partial revert of #161671, restoring the original behaviour
where the canonical template arguments are used for function template
constraint checking in diagnostics.
This reverts the fix from #183010, which attempted to fix #182344
but it causes regressions. These regressions now have test cases
included.
The attempt at #183010 is flawed because in the general case we can't
check satisfaction for constraints which have unsubstituted template
arguments, even if they don't affect the canonical type (ie they are
purely
syntactical), because these types can still turn out to be invalid after
substitution.
[20 lines not shown]
[clang] use canonical arguments for checking function template constraints (#186889)
This is a partial revert of #161671, restoring the original behaviour
where the canonical template arguments are used for function template
constraint checking in diagnostics.
This reverts the fix from #183010, which attempted to fix #182344
but it causes regressions. These regressions now have test cases
included.
The attempt at #183010 is flawed because in the general case we can't
check satisfaction for constraints which have unsubstituted template
arguments, even if they don't affect the canonical type (ie they are
purely
syntactical), because these types can still turn out to be invalid after
substitution.
This is a problem when directly evaluating a concept specialization, but
it's not a problem with other template specializations because the
[18 lines not shown]
[ssaf][UnsafeBufferUsage] Add support for extracting unsafe pointers from all kinds of contributors
- Generalize the -Wunsafe-buffer-usage API for finding unsafe pointers in all kinds of Decls
- Add support in SSAF-based UnsafeBufferUsage analysis for extracting from various contributors
- Mock implementation of HandleTranslationUnit
rdar://171735836
[Clang] Fix a concept subsumption bug when template depths are adjusted (#186735)
We cannot reuse the cached normalization results if any template depth
adjustments (in subsumption checking) are involved.
Fixes https://github.com/llvm/llvm-project/issues/186624
[X86] Improve illegal return type handling in FastISel (#186723)
Previously, FastISel would fall back to DAG ISel for any illegal return
type. This change adds a more precise check to determine if the ABI
requires a type conversion that FastISel cannot handle.
For example, bfloat is returned as f16 in XMM0, but FastISel would
assign f32 register type and store it in FuncInfo.ValueMap, causing DAG
to incorrectly perform type conversion from f32 to bfloat later.
However, i1 is promoted to i8 and returned as i8 per the ABI, so
FastISel
can safely lower it without switching to DAGISel. This change enables
FastISel to handle such cases properly.
---------
Co-authored-by: Yuanke Luo <ykluo at birentech.com>