7
7
#include " cpp2util.h"
8
8
9
9
10
- #line 25 "pure2-bugfix-for-deducible-parameters.cpp2"
10
+ #line 32 "pure2-bugfix-for-deducible-parameters.cpp2"
11
11
template <typename T> class v ;
12
12
13
13
@@ -24,15 +24,15 @@ template<typename T> auto id(cpp2::in<std::integral_constant<cpp2::i32,T::value>
24
24
auto main () -> int;
25
25
26
26
27
- #line 25 "pure2-bugfix-for-deducible-parameters.cpp2"
27
+ #line 32 "pure2-bugfix-for-deducible-parameters.cpp2"
28
28
template <typename T> class v {
29
29
public: explicit v (T const & x);
30
- #line 26 "pure2-bugfix-for-deducible-parameters.cpp2"
30
+ #line 33 "pure2-bugfix-for-deducible-parameters.cpp2"
31
31
public: auto operator =(T const & x) -> v& ;
32
32
33
33
public: v(v const &) = delete ; /* No 'that' constructor, suppress copy */
34
34
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"
36
36
};
37
37
38
38
@@ -58,15 +58,31 @@ auto main() -> int{
58
58
(void ) []<typename T>(std::vector<std::vector<T>> const & x) -> void {}(std::vector<std::vector<cpp2::i32>>{});
59
59
// Uncomment once `typename` is supported for template arguments.
60
60
// _ = :<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 ());
61
62
init (cpp2::out (&z.value ()), z.value ());
62
63
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"
63
79
}
64
80
65
- #line 26 "pure2-bugfix-for-deducible-parameters.cpp2"
81
+ #line 33 "pure2-bugfix-for-deducible-parameters.cpp2"
66
82
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"
68
84
template <typename T> auto v<T>::operator =(T const & x) -> v& {
69
85
return *this ;
70
- #line 26 "pure2-bugfix-for-deducible-parameters.cpp2"
86
+ #line 33 "pure2-bugfix-for-deducible-parameters.cpp2"
71
87
}
72
88
0 commit comments