diff options
author | Matheus Izvekov <mizvekov@gmail.com> | 2024-05-16 18:44:41 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 18:44:41 -0300 |
commit | c86a53d75995d65601d5745b2fceb2d50a970645 (patch) | |
tree | 0a46399a0196f958ee3a23c1980ec1eb61db0060 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | |
parent | 997eae3673dcd635b60ac63031f01f5dded92f32 (diff) | |
download | llvm-c86a53d75995d65601d5745b2fceb2d50a970645.zip llvm-c86a53d75995d65601d5745b2fceb2d50a970645.tar.gz llvm-c86a53d75995d65601d5745b2fceb2d50a970645.tar.bz2 |
[clang] Implement provisional wording for CWG2398 regarding packs (#90820)
This solves some ambuguity introduced in P0522 regarding how
template template parameters are partially ordered, and should reduce
the negative impact of enabling `-frelaxed-template-template-args`
by default.
When performing template argument deduction, a template template
parameter
containing no packs should be more specialized than one that does.
Given the following example:
```C++
template<class T2> struct A;
template<template<class ...T3s> class TT1, class T4> struct A<TT1<T4>>; // #1
template<template<class T5 > class TT2, class T6> struct A<TT2<T6>>; // #2
template<class T1> struct B;
template struct A<B<char>>;
```
Prior to P0522, candidate `#2` would be more specialized.
After P0522, neither is more specialized, so this becomes ambiguous.
With this change, `#2` becomes more specialized again,
maintaining compatibility with pre-P0522 implementations.
The problem is that in P0522, candidates are at least as specialized
when matching packs to fixed-size lists both ways, whereas before,
a fixed-size list is more specialized.
This patch keeps the original behavior when checking template arguments
outside deduction, but restores this aspect of pre-P0522 matching
during deduction.
---
Since this changes provisional implementation of CWG2398 which has
not been released yet, and already contains a changelog entry,
we don't provide a changelog entry here.
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions