@@ -46,76 +46,76 @@ template<typename T, T::value_type V> [[nodiscard]] auto f(cpp2::in<typename T::
46
46
return { typename T::value_type{x} };
47
47
48
48
// 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{}) ;
53
53
54
54
// Emitted `template`.
55
55
using ptr = T*; // Needed, pending #502.
56
56
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.
61
61
// Uncomment once `typename` is supported for template arguments.
62
62
// _ = :identity<typename std::pointer_traits<ptr>::rebind<ptr>> = (); // Non type-only context.
63
63
64
64
// Aliases.
65
65
using w = T;
66
- ( void ) typename w::value_type{x};
66
+ static_cast < void >( typename w::value_type{x}) ;
67
67
using v = w;
68
- ( void ) typename v::value_type{x};
68
+ static_cast < void >( typename v::value_type{x}) ;
69
69
using a = T::type;
70
- ( void ) typename a::value_type{x};
70
+ static_cast < void >( typename a::value_type{x}) ;
71
71
72
72
{
73
73
// 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>`.
76
76
77
77
// Test that non-dependent names aren't emitted with `typename`.
78
78
using a = std::integral_constant<cpp2::i32 ,0 >;
79
79
using b = a;
80
80
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}) ;
83
83
}
84
84
}
85
85
86
86
#line 56 "pure2-bugfix-for-dependent-types.cpp2"
87
87
auto main () -> int{
88
88
using zero = std::integral_constant<cpp2::i32 ,0 >;
89
- ( void ) f<zero,0 >(0 );
89
+ static_cast < void >( f<zero,0 >(0 ) );
90
90
91
91
// 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 {}) );
93
93
94
94
// 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 {}) ; }) ; }) ; }) ;
106
106
107
107
// Lookup.
108
108
{
109
109
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.
111
111
}
112
- ( void ) []<typename T>(T const & _ ) -> void {
112
+ static_cast < void >( []<typename T>([[maybe_unused]] T const & param1 ) -> void {
113
113
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.
115
115
{
116
116
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.
118
118
}
119
- }(0 );
119
+ }(0 )) ;
120
120
}
121
121
0 commit comments