upsj wrote:
Take an (albeit a bit constructed) example like
```cpp
#include <memory>
struct S {
S(int a, int b);
int a;
int b;
};
template <typename T>
struct container {
template <typename... Args>
container(int i, Args... args) {
T{std::forward<Args>(args)...};
}
};
int main() {
std::make_unique<container<S>>(/*i:*/1, /*a:*/2, /*b:*/3);
}
```
some of the parameters here are being forwarded to a fixed parameter earlier,
some of them only in the second recursion level. This currently works, but
would not work without the constructor, which your PR is aiming to change.
Mapping individual parameters work for every case, mapping only a single type
seems unnecessarily restrictive.
About base cases, I would imagine a test case similar to this:
```cpp
struct A {
int a;
int aa;
};
struct B : A {
int b;
};
B b{/*a:*/1, /*aa:*/2, /*b:*/2};
```
https://github.com/llvm/llvm-project/pull/176635
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits