77#include " cpp2util.h"
88
99
10- #line 25 "pure2-bugfix-for-deducible-parameters.cpp2"
10+ #line 32 "pure2-bugfix-for-deducible-parameters.cpp2"
1111template <typename T> class v ;
1212
1313
@@ -24,15 +24,15 @@ template<typename T> auto id(cpp2::in<std::integral_constant<cpp2::i32,T::value>
2424auto main () -> int;
2525
2626
27- #line 25 "pure2-bugfix-for-deducible-parameters.cpp2"
27+ #line 32 "pure2-bugfix-for-deducible-parameters.cpp2"
2828template <typename T> class v {
2929 public: explicit v (T const & x);
30- #line 26 "pure2-bugfix-for-deducible-parameters.cpp2"
30+ #line 33 "pure2-bugfix-for-deducible-parameters.cpp2"
3131 public: auto operator =(T const & x) -> v& ;
3232
3333 public: v(v const &) = delete ; /* No 'that' constructor, suppress copy */
3434 public: auto operator =(v const &) -> void = delete ;
35- #line 27 "pure2-bugfix-for-deducible-parameters.cpp2"
35+ #line 34 "pure2-bugfix-for-deducible-parameters.cpp2"
3636};
3737
3838
@@ -58,15 +58,31 @@ auto main() -> int{
5858 (void ) []<typename T>(std::vector<std::vector<T>> const & x) -> void {}(std::vector<std::vector<cpp2::i32 >>{});
5959 // Uncomment once `typename` is supported for template arguments.
6060 // _ = :<T, U> (x: std::pair<T, typename U::value_type>, y: U) = {}(:std::pair = (0, 0), z);
61+ (void ) []<typename T, typename U>(std::array<T,U::value> const & x, U const & y) -> void {}(std::array<cpp2::i32 ,0 >{}, z.value ());
6162 init (cpp2::out (&z.value ()), z.value ());
6263 id (z.value (), std::move (z.value ()));
64+ {
65+ auto f = []<typename T>(std::vector<std::type_identity_t <T>> const & x) -> void {};
66+
67+ // Test that these are emitted unwrapped in case they are deducible.
68+
69+ #line 27 "pure2-bugfix-for-deducible-parameters.cpp2"
70+ static_assert (!(std::is_invocable_v<decltype (f),std::vector<cpp2::i32 >>));
71+ }
72+ {
73+ auto f = []<typename T>(std::vector<std::vector<T>> const & x) -> void {};
74+
75+ #line 29 "pure2-bugfix-for-deducible-parameters.cpp2"
76+ static_assert (std::is_invocable_v<decltype (f),std::vector<std::vector<cpp2::i32 >>>);
77+ }
78+ #line 30 "pure2-bugfix-for-deducible-parameters.cpp2"
6379}
6480
65- #line 26 "pure2-bugfix-for-deducible-parameters.cpp2"
81+ #line 33 "pure2-bugfix-for-deducible-parameters.cpp2"
6682 template <typename T> v<T>::v(T const & x){}
67- #line 26 "pure2-bugfix-for-deducible-parameters.cpp2"
83+ #line 33 "pure2-bugfix-for-deducible-parameters.cpp2"
6884 template <typename T> auto v<T>::operator =(T const & x) -> v& {
6985 return *this ;
70- #line 26 "pure2-bugfix-for-deducible-parameters.cpp2"
86+ #line 33 "pure2-bugfix-for-deducible-parameters.cpp2"
7187 }
7288
0 commit comments