Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/class-deduction103.C

raw
1 // PR c++/103672
2 // { dg-do compile { target c++17 } }
3
4 template<class T>
5 struct unique {
6 template<class... Args>
7 T* operator()(Args&&... args);
8 };
9
10 template<template<class...> class T, class... Args>
11 using deduced_type = decltype(T{Args{}...});
12
13 template<template<class> class F, template<class...> class T, class... Args>
14 auto make(Args&&... args) {
15 return F<deduced_type<T, Args...>>{}(args...);
16 }
17
18 template<class A, class B>
19 struct Foo { Foo(A,B); };
20
21 using type = decltype(make<unique, Foo>(1, 2));
22 using type = Foo<int, int>*;