| 1 |
// PR c++/99683 |
| 2 |
// { dg-do compile { target c++20 } } |
| 3 |
|
| 4 |
template<auto V> |
| 5 |
struct nttp_tag {}; |
| 6 |
|
| 7 |
template<typename T> |
| 8 |
struct type_tag {}; |
| 9 |
|
| 10 |
|
| 11 |
/************************************************/ |
| 12 |
template<bool is_type> |
| 13 |
struct use_ctad |
| 14 |
{ |
| 15 |
template<auto V> requires (!is_type) |
| 16 |
constexpr use_ctad(nttp_tag<V>) {} |
| 17 |
}; |
| 18 |
|
| 19 |
template<auto V> |
| 20 |
use_ctad(nttp_tag<V>) -> use_ctad<false>; |
| 21 |
|
| 22 |
/**********************************************/ |
| 23 |
template<use_ctad t> |
| 24 |
struct wrapper |
| 25 |
{ |
| 26 |
template<typename Tag> |
| 27 |
wrapper(Tag); |
| 28 |
}; |
| 29 |
|
| 30 |
template<typename Tag> |
| 31 |
wrapper(Tag) -> wrapper<use_ctad{Tag()}>; |
| 32 |
|
| 33 |
int main() |
| 34 |
{ |
| 35 |
wrapper t{nttp_tag<42>{}}; |
| 36 |
} |