diff --git a/common/main/valptridx.tcc b/common/main/valptridx.tcc index 45c2e94a8..fc491b321 100644 --- a/common/main/valptridx.tcc +++ b/common/main/valptridx.tcc @@ -9,6 +9,7 @@ #include #include #include "valptridx.h" +#include "compiler-addressof.h" namespace untyped_index_mismatch_exception { @@ -81,7 +82,7 @@ void valptridx::index_mismatch_exception::report(DXX_VALPTRIDX_REP { using namespace untyped_index_mismatch_exception; char buf[report_buffer_size]; - prepare_report(DXX_VALPTRIDX_REPORT_STANDARD_LEADER_COMMA_R_PASS_VARS static_cast(&array[0]), supplied_index, expected_pointer, actual_pointer, buf, array.size()); + prepare_report(DXX_VALPTRIDX_REPORT_STANDARD_LEADER_COMMA_R_PASS_VARS addressof(array), supplied_index, expected_pointer, actual_pointer, buf, array.size()); throw index_mismatch_exception(buf); } @@ -108,6 +109,6 @@ void valptridx::null_pointer_exception::report(DXX_VALPTRIDX_REPOR { using namespace untyped_null_pointer_exception; char buf[report_buffer_size]; - prepare_report(DXX_VALPTRIDX_REPORT_STANDARD_LEADER_COMMA_R_PASS_VARS static_cast(&array[0]), buf, array.size()); + prepare_report(DXX_VALPTRIDX_REPORT_STANDARD_LEADER_COMMA_R_PASS_VARS addressof(array), buf, array.size()); throw null_pointer_exception(buf); }