c++: P0847R7 (deducing this) - xobj lambdas. [PR102609]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / nontype-class48.C
blob9024436cad85ea1ca28260ebb3ec6d0581a6661f
1 // PR c++/99683
2 // { dg-do compile { target c++20 } }
4 template<auto V>
5 struct nttp_tag {};
7 template<typename T>
8 struct type_tag {};
11 /************************************************/
12 template<bool is_type>
13 struct use_ctad
15     template<auto V> requires (!is_type)
16     constexpr use_ctad(nttp_tag<V>) {}
19 template<auto V>
20 use_ctad(nttp_tag<V>) -> use_ctad<false>;
22 /**********************************************/
23 template<use_ctad t>
24 struct wrapper 
26     template<typename Tag>
27     wrapper(Tag);
30 template<typename Tag>
31 wrapper(Tag) -> wrapper<use_ctad{Tag()}>;
33 int main()
35     wrapper t{nttp_tag<42>{}};