88
99#line 1 "pure2-bugfix-for-deducible-parameters.cpp2"
1010
11- #line 31 "pure2-bugfix-for-deducible-parameters.cpp2"
11+ #line 30 "pure2-bugfix-for-deducible-parameters.cpp2"
1212template <typename T> class v ;
1313
1414
1515// === Cpp2 type definitions and function declarations ===========================
1616
1717#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"
2120template <typename T> auto init (cpp2::out<std::integral_constant<cpp2::i32 ,T::value>> x) -> void;
2221template <typename T> auto init (cpp2::out<std::integral_constant<cpp2::i32 ,T::value>> x, [[maybe_unused]] T const & unnamed_param_2) -> void;
2322template <typename T> [[nodiscard]] auto id (cpp2::in<std::integral_constant<cpp2::i32 ,T::value>> x) -> auto&&;
2423template <typename T> auto id (cpp2::in<std::integral_constant<cpp2::i32 ,T::value>> x, T const & y) -> void;
2524
2625auto main () -> int;
2726
28- #line 31 "pure2-bugfix-for-deducible-parameters.cpp2"
27+ #line 30 "pure2-bugfix-for-deducible-parameters.cpp2"
2928template <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& ;
3332 public: v(v const &) = delete ; /* No 'that' constructor, suppress copy */
3433 public: auto operator =(v const &) -> void = delete ;
3534
36- #line 33 "pure2-bugfix-for-deducible-parameters.cpp2"
35+ #line 32 "pure2-bugfix-for-deducible-parameters.cpp2"
3736};
3837
3938
4039// === Cpp2 function definitions =================================================
4140
4241#line 1 "pure2-bugfix-for-deducible-parameters.cpp2"
4342
44- #line 3 "pure2-bugfix-for-deducible-parameters.cpp2"
43+ #line 2 "pure2-bugfix-for-deducible-parameters.cpp2"
4544template <typename T> auto init (cpp2::out<std::integral_constant<cpp2::i32 ,T::value>> x) -> void{x.construct (); }
4645template <typename T> auto init (cpp2::out<std::integral_constant<cpp2::i32 ,T::value>> x, [[maybe_unused]] T const & unnamed_param_2) -> void{x.construct (); }
4746template <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{
5554 cpp2::Default.expects (&id<zero>(z.value ()) == &z.value (), " " );
5655
5756 // 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 >>{});
6160 // _ = :<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 ());
6362 init (cpp2::out (&z.value ()), z.value ());
6463 id (z.value (), std::move (z.value ()));
6564{
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 {};
6766
6867 // Test that these are emitted unwrapped in case they are deducible.
6968
70- #line 26 "pure2-bugfix-for-deducible-parameters.cpp2"
69+ #line 25 "pure2-bugfix-for-deducible-parameters.cpp2"
7170 static_assert (!(std::is_invocable_v<decltype (f),std::vector<cpp2::i32 >>), " `T` is non-deducible." );
7271}
7372{
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 {};
7574
76- #line 28 "pure2-bugfix-for-deducible-parameters.cpp2"
75+ #line 27 "pure2-bugfix-for-deducible-parameters.cpp2"
7776 static_assert (std::is_invocable_v<decltype (std::move (f)),std::vector<std::vector<cpp2::i32 >>>, " `T` is deducible." );
7877}
79- #line 29 "pure2-bugfix-for-deducible-parameters.cpp2"
78+ #line 28 "pure2-bugfix-for-deducible-parameters.cpp2"
8079}
8180
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& {
8685 return *this ; }
8786
0 commit comments