@@ -46,76 +46,76 @@ template<typename T, T::value_type V> [[nodiscard]] auto f(cpp2::in<typename T::
4646 return { typename T::value_type{x} };
4747
4848 // Dependent *template-id*s.
49- ( void ) typename identity<T>::value_type{};// First identifier.
50- ( void ) typename std::optional<T>::value_type{};// Non-first identifier.
51- ( void ) typename std::array<cpp2::i32 ,T::value>::value_type{};
52- ( void ) typename std::array<cpp2::i32 ,T::value + T::value>::value_type{};
49+ static_cast < void >( typename identity<T>::value_type{}) ;// First identifier.
50+ static_cast < void >( typename std::optional<T>::value_type{}) ;// Non-first identifier.
51+ static_cast < void >( typename std::array<cpp2::i32 ,T::value>::value_type{}) ;
52+ static_cast < void >( typename std::array<cpp2::i32 ,T::value + T::value>::value_type{}) ;
5353
5454 // Emitted `template`.
5555 using ptr = T*; // Needed, pending #502.
5656 using nptr = cpp2::i32 *; // Needed, pending #502.
57- ( void ) typename std::pointer_traits<ptr>::template rebind<ptr>{};// Type-only context.
58- ( void ) std::pointer_traits<nptr>::rebind<nptr>{}; // Non-dependent.
59- ( void ) std::pointer_traits<nptr>::rebind<ptr>{}; // Dependent on the nested template.
60- ( void ) typename std::pointer_traits<ptr>::template rebind<nptr>{};// Dependent on the outer template.
57+ static_cast < void >( typename std::pointer_traits<ptr>::template rebind<ptr>{}) ;// Type-only context.
58+ static_cast < void >( std::pointer_traits<nptr>::rebind<nptr>{}); // Non-dependent.
59+ static_cast < void >( std::pointer_traits<nptr>::rebind<ptr>{}); // Dependent on the nested template.
60+ static_cast < void >( typename std::pointer_traits<ptr>::template rebind<nptr>{}) ;// Dependent on the outer template.
6161 // Uncomment once `typename` is supported for template arguments.
6262 // _ = :identity<typename std::pointer_traits<ptr>::rebind<ptr>> = (); // Non type-only context.
6363
6464 // Aliases.
6565 using w = T;
66- ( void ) typename w::value_type{x};
66+ static_cast < void >( typename w::value_type{x}) ;
6767 using v = w;
68- ( void ) typename v::value_type{x};
68+ static_cast < void >( typename v::value_type{x}) ;
6969 using a = T::type;
70- ( void ) typename a::value_type{x};
70+ static_cast < void >( typename a::value_type{x}) ;
7171
7272 {
7373 // Test that there's no prefixed `typename` to....
74- ( void ) std::integral_constant<cpp2::i32 ,T::value>();// `T::value`.
75- ( void ) std::type_identity_t <T>{}; // `std::type_identity_t<T>`.
74+ static_cast < void >( std::integral_constant<cpp2::i32 ,T::value>() );// `T::value`.
75+ static_cast < void >( std::type_identity_t <T>{}); // `std::type_identity_t<T>`.
7676
7777 // Test that non-dependent names aren't emitted with `typename`.
7878 using a = std::integral_constant<cpp2::i32 ,0 >;
7979 using b = a;
8080 using c = b;
81- ( void ) b::value_type{x};
82- ( void ) c::value_type{x};
81+ static_cast < void >( b::value_type{x}) ;
82+ static_cast < void >( c::value_type{x}) ;
8383 }
8484}
8585
8686#line 56 "pure2-bugfix-for-dependent-types.cpp2"
8787auto main () -> int{
8888 using zero = std::integral_constant<cpp2::i32 ,0 >;
89- ( void ) f<zero,0 >(0 );
89+ static_cast < void >( f<zero,0 >(0 ) );
9090
9191 // Emitted `template` (noop, taken care of by the UFCS macro).
92- ( void ) [](auto const & f) -> void {( void ) CPP2_UFCS_TEMPLATE_0 (operator (), (<cpp2::i32 >), f); }([]<typename T>() -> void {});
92+ static_cast < void >( [](auto const & f) -> void {static_cast < void >( CPP2_UFCS_TEMPLATE_0 (operator (), (<cpp2::i32 >), f)) ; }([]<typename T>() -> void {}) );
9393
9494 // Nesting is irrelevant.
95- ( void ) []<typename T>() -> void {( void ) typename T::value_type{}; };
96- ( void ) []() -> void {( void ) []<typename T>() -> void {( void ) typename T::value_type{}; }; };
97- ( void ) []() -> void {( void ) []() -> void {( void ) []<typename T>() -> void {( void ) typename T::value_type{}; }; }; };
98- ( void ) []() -> void {( void ) []() -> void {( void ) []() -> void {( void ) []<typename T>() -> void {( void ) typename T::value_type{}; }; }; }; };
99- ( void ) []() -> void {( void ) []() -> void {( void ) []<typename T>() -> void {( void ) []() -> void {( void ) typename T::value_type{}; }; }; }; };
100- ( void ) []() -> void {( void ) []<typename T>() -> void {( void ) []() -> void {( void ) []() -> void {( void ) typename T::value_type{}; }; }; }; };
101- ( void ) []<typename T>() -> void {( void ) []() -> void {( void ) []() -> void {( void ) []() -> void {( void ) typename T::value_type{}; }; }; }; };
102- ( void ) []<typename T>() -> void {( void ) []() -> void {( void ) []() -> void {( void ) [](cpp2::in<typename T::value_type> x) -> void {}; }; }; };
103- ( void ) []<typename T>() -> void {( void ) []() -> void {( void ) [](cpp2::in<typename T::value_type> x) -> void {( void ) []() -> void {}; }; }; };
104- ( void ) []<typename T>() -> void {( void ) [](cpp2::in<typename T::value_type> x) -> void {( void ) []() -> void {( void ) []() -> void {}; }; }; };
105- ( void ) []<typename T>(cpp2::in<typename T::value_type> x) -> void {( void ) []() -> void {( void ) []() -> void {( void ) []() -> void {}; }; }; };
95+ static_cast < void >( []<typename T>() -> void {static_cast < void >( typename T::value_type{}) ; }) ;
96+ static_cast < void >( []() -> void {static_cast < void >( []<typename T>() -> void {static_cast < void >( typename T::value_type{}) ; }) ; }) ;
97+ static_cast < void >( []() -> void {static_cast < void >( []() -> void {static_cast < void >( []<typename T>() -> void {static_cast < void >( typename T::value_type{}) ; }) ; }) ; }) ;
98+ static_cast < void >( []() -> void {static_cast < void >( []() -> void {static_cast < void >( []() -> void {static_cast < void >( []<typename T>() -> void {static_cast < void >( typename T::value_type{}) ; }) ; }) ; }) ; }) ;
99+ static_cast < void >( []() -> void {static_cast < void >( []() -> void {static_cast < void >( []<typename T>() -> void {static_cast < void >( []() -> void {static_cast < void >( typename T::value_type{}) ; }) ; }) ; }) ; }) ;
100+ static_cast < void >( []() -> void {static_cast < void >( []<typename T>() -> void {static_cast < void >( []() -> void {static_cast < void >( []() -> void {static_cast < void >( typename T::value_type{}) ; }) ; }) ; }) ; }) ;
101+ static_cast < void >( []<typename T>() -> void {static_cast < void >( []() -> void {static_cast < void >( []() -> void {static_cast < void >( []() -> void {static_cast < void >( typename T::value_type{}) ; }) ; }) ; }) ; }) ;
102+ static_cast < void >( []<typename T>() -> void {static_cast < void >( []() -> void {static_cast < void >( []() -> void {static_cast < void >( [](cpp2::in<typename T::value_type> x) -> void {}) ; }) ; }) ; }) ;
103+ static_cast < void >( []<typename T>() -> void {static_cast < void >( []() -> void {static_cast < void >( [](cpp2::in<typename T::value_type> x) -> void {static_cast < void >( []() -> void {}) ; }) ; }) ; }) ;
104+ static_cast < void >( []<typename T>() -> void {static_cast < void >( [](cpp2::in<typename T::value_type> x) -> void {static_cast < void >( []() -> void {static_cast < void >( []() -> void {}) ; }) ; }) ; }) ;
105+ static_cast < void >( []<typename T>(cpp2::in<typename T::value_type> x) -> void {static_cast < void >( []() -> void {static_cast < void >( []() -> void {static_cast < void >( []() -> void {}) ; }) ; }) ; }) ;
106106
107107 // Lookup.
108108 {
109109 using alias = std::integral_constant<cpp2::i32 ,0 >;
110- ( void ) alias::value_type{0 };// Non-dependent.
110+ static_cast < void >( alias::value_type{0 }) ;// Non-dependent.
111111 }
112- ( void ) []<typename T>(T const & _ ) -> void {
112+ static_cast < void >( []<typename T>([[maybe_unused]] T const & param1 ) -> void {
113113 using alias = std::integral_constant<T,0 >;
114- ( void ) typename alias::value_type{0 };// Dependent.
114+ static_cast < void >( typename alias::value_type{0 }) ;// Dependent.
115115 {
116116 using alias = std::integral_constant<cpp2::i32 ,0 >;
117- ( void ) typename alias::value_type{0 };// Non-dependent.
117+ static_cast < void >( typename alias::value_type{0 }) ;// Non-dependent.
118118 }
119- }(0 );
119+ }(0 )) ;
120120}
121121
0 commit comments