Skip to content

Commit 4966a77

Browse files
Keerthi Timmarajumborland
Keerthi Timmaraju
authored andcommitted
fix unreachable return compilation error
On Visual Studio 16.9, the return was marked as unreachable because of the throw before
1 parent ee2ec56 commit 4966a77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/boost/test/utils/named_params.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ struct nil {
131131
#else
132132
operator T const&() const
133133
#endif
134-
{ nfp_detail::report_access_to_invalid_parameter(true); static T* v = 0; return *v; }
134+
{ nfp_detail::report_access_to_invalid_parameter(true); static T* v = 0; BOOST_TEST_UNREACHABLE_RETURN(*v); }
135135

136136
template<typename T>
137137
T any_cast() const
138-
{ nfp_detail::report_access_to_invalid_parameter(true); static typename remove_reference<T>::type* v = 0; return *v; }
138+
{ nfp_detail::report_access_to_invalid_parameter(true); static typename remove_reference<T>::type* v = 0; BOOST_TEST_UNREACHABLE_RETURN(*v); }
139139

140140
template<typename Arg1>
141141
nil operator()( Arg1 const& )

0 commit comments

Comments
 (0)