| Issue |
64719
|
| Summary |
[libc++] _LIBCPP_CTAD_SUPPORTED_FOR_TYPE does not work for out of class defined nested classes
|
| Labels |
libc++
|
| Assignees |
|
| Reporter |
crtrott
|
I ran into this problem with mdspan layouts, when I tried to rely on the implicitly defined deduction guides.
That works but produces a warning with `-Wctad-maybe-unsupported` on the compile line.
It was suggested to use `_LIBCPP_CTAD_SUPPORTED_FOR_TYPE` but that gives a compile error: https://godbolt.org/z/7n48snYfb
Adding the deduction guide explicitly in the `layout_left` class leads to this warning:
```
__fwd/mdspan.h:55:3: error: unused function template '<deduction guide for mapping>' [-Werror,-Wunused-template]
55 | mapping(_Extents, array<_OtherIndexType, _Extents::rank>) -> mapping<_Extents>;
```
which I can silence with a `[[maybe_unused]]`
Here is the code reproducer:
```c++
#include <__config>
#include<array>
struct layout_left {
template<class E>
struct mapping;
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(mapping);
};
template<class E>
struct layout_left::mapping {
template<class T>
mapping(E e, std::array<T, 1> a) {}
};
void func() {
layout_left::mapping m(5, std::array<int,1>{1});
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs