8
8
9
9
#line 1 "pure2-bugfix-for-deducible-parameters.cpp2"
10
10
11
- #line 31 "pure2-bugfix-for-deducible-parameters.cpp2"
11
+ #line 30 "pure2-bugfix-for-deducible-parameters.cpp2"
12
12
template <typename T> class v ;
13
13
14
14
15
15
// === Cpp2 type definitions and function declarations ===========================
16
16
17
17
#line 1 "pure2-bugfix-for-deducible-parameters.cpp2"
18
- // Dependent, non-deducible parameters
19
- // are wrapped like non-dependent parameters.
20
- #line 3 "pure2-bugfix-for-deducible-parameters.cpp2"
18
+ // Dependent, non-deducible parameters are wrapped like non-dependent parameters.
19
+ #line 2 "pure2-bugfix-for-deducible-parameters.cpp2"
21
20
template <typename T> auto init (cpp2::out<std::integral_constant<cpp2::i32 ,T::value>> x) -> void;
22
21
template <typename T> auto init (cpp2::out<std::integral_constant<cpp2::i32 ,T::value>> x, [[maybe_unused]] T const & unnamed_param_2) -> void;
23
22
template <typename T> [[nodiscard]] auto id (cpp2::in<std::integral_constant<cpp2::i32 ,T::value>> x) -> auto&&;
24
23
template <typename T> auto id (cpp2::in<std::integral_constant<cpp2::i32 ,T::value>> x, T const & y) -> void;
25
24
26
25
auto main () -> int;
27
26
28
- #line 31 "pure2-bugfix-for-deducible-parameters.cpp2"
27
+ #line 30 "pure2-bugfix-for-deducible-parameters.cpp2"
29
28
template <typename T> class v {
30
- public: explicit v (T const & x );
31
- #line 32 "pure2-bugfix-for-deducible-parameters.cpp2"
32
- public: auto operator =(T const & x ) -> v& ;
29
+ public: explicit v ([[maybe_unused]] T const & unnamed_param_2 );
30
+ #line 31 "pure2-bugfix-for-deducible-parameters.cpp2"
31
+ public: auto operator =([[maybe_unused]] T const & unnamed_param_2 ) -> v& ;
33
32
public: v(v const &) = delete ; /* No 'that' constructor, suppress copy */
34
33
public: auto operator =(v const &) -> void = delete ;
35
34
36
- #line 33 "pure2-bugfix-for-deducible-parameters.cpp2"
35
+ #line 32 "pure2-bugfix-for-deducible-parameters.cpp2"
37
36
};
38
37
39
38
40
39
// === Cpp2 function definitions =================================================
41
40
42
41
#line 1 "pure2-bugfix-for-deducible-parameters.cpp2"
43
42
44
- #line 3 "pure2-bugfix-for-deducible-parameters.cpp2"
43
+ #line 2 "pure2-bugfix-for-deducible-parameters.cpp2"
45
44
template <typename T> auto init (cpp2::out<std::integral_constant<cpp2::i32 ,T::value>> x) -> void{x.construct (); }
46
45
template <typename T> auto init (cpp2::out<std::integral_constant<cpp2::i32 ,T::value>> x, [[maybe_unused]] T const & unnamed_param_2) -> void{x.construct (); }
47
46
template <typename T> [[nodiscard]] auto id (cpp2::in<std::integral_constant<cpp2::i32 ,T::value>> x) -> auto&& { return x; }
@@ -55,33 +54,33 @@ auto main() -> int{
55
54
cpp2::Default.expects (&id<zero>(z.value ()) == &z.value (), " " );
56
55
57
56
// Deducible parameters.
58
- static_cast <void >(v{0 });
59
- static_cast < void >( []<typename T>(std::vector<T> const & x ) mutable -> void {}(std::vector<cpp2::i32 >{}) );
60
- static_cast < void >( []<typename T>(std::vector<std::vector<T>> const & x ) mutable -> void {}(std::vector<std::vector<cpp2::i32 >>{}) );
57
+ static_cast <void >(v{ 0 });
58
+ []<typename T>([[maybe_unused]] std::vector<T> const & unnamed_param_1 ) mutable -> void {}(std::vector<cpp2::i32 >{});
59
+ []<typename T>([[maybe_unused]] std::vector<std::vector<T>> const & unnamed_param_1 ) mutable -> void {}(std::vector<std::vector<cpp2::i32 >>{});
61
60
// _ = :<T, U> (x: std::pair<T, typename U::value_type>, y: U) = {}(:std::pair = (0, 0), z); // Blocked on #727.
62
- static_cast < void >( []<typename T, typename U>(std::array<T,U::value> const & x, U const & y ) mutable -> void {}(std::array<cpp2::i32 ,0 >{}, z.value () ));
61
+ []<typename T, typename U>([[maybe_unused]] std::array<T,U::value> const & unnamed_param_1, [[maybe_unused]] U const & unnamed_param_2 ) mutable -> void {}(std::array<cpp2::i32 ,0 >{}, z.value ());
63
62
init (cpp2::out (&z.value ()), z.value ());
64
63
id (z.value (), std::move (z.value ()));
65
64
{
66
- auto f = []<typename T>(std::vector<std::type_identity_t <T>> const & x ) mutable -> void {};
65
+ auto f = []<typename T>([[maybe_unused]] std::vector<std::type_identity_t <T>> const & unnamed_param_1 ) mutable -> void {};
67
66
68
67
// Test that these are emitted unwrapped in case they are deducible.
69
68
70
- #line 26 "pure2-bugfix-for-deducible-parameters.cpp2"
69
+ #line 25 "pure2-bugfix-for-deducible-parameters.cpp2"
71
70
static_assert (!(std::is_invocable_v<decltype (f),std::vector<cpp2::i32 >>), " `T` is non-deducible." );
72
71
}
73
72
{
74
- auto f = []<typename T>(std::vector<std::vector<T>> const & x ) mutable -> void {};
73
+ auto f = []<typename T>([[maybe_unused]] std::vector<std::vector<T>> const & unnamed_param_1 ) mutable -> void {};
75
74
76
- #line 28 "pure2-bugfix-for-deducible-parameters.cpp2"
75
+ #line 27 "pure2-bugfix-for-deducible-parameters.cpp2"
77
76
static_assert (std::is_invocable_v<decltype (std::move (f)),std::vector<std::vector<cpp2::i32 >>>, " `T` is deducible." );
78
77
}
79
- #line 29 "pure2-bugfix-for-deducible-parameters.cpp2"
78
+ #line 28 "pure2-bugfix-for-deducible-parameters.cpp2"
80
79
}
81
80
82
- #line 32 "pure2-bugfix-for-deducible-parameters.cpp2"
83
- template <typename T> v<T>::v(T const & x ){}
84
- #line 32 "pure2-bugfix-for-deducible-parameters.cpp2"
85
- template <typename T> auto v<T>::operator =(T const & x ) -> v& {
81
+ #line 31 "pure2-bugfix-for-deducible-parameters.cpp2"
82
+ template <typename T> v<T>::v([[maybe_unused]] T const & unnamed_param_2 ){}
83
+ #line 31 "pure2-bugfix-for-deducible-parameters.cpp2"
84
+ template <typename T> auto v<T>::operator =([[maybe_unused]] T const & unnamed_param_2 ) -> v& {
86
85
return *this ; }
87
86
0 commit comments