diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index daceb8f32d..ef3883a427 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -805,6 +805,7 @@ // warning C5045: Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified (/Wall) // warning C5220: a non-static data member with a volatile qualified type no longer implies that compiler generated // copy/move constructors and copy/move assignment operators are not trivial (/Wall) +// warning C5246: 'member': the initialization of a subobject should be wrapped in braces (/Wall) // warning C6294: Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed #ifndef _STL_DISABLED_WARNINGS @@ -812,7 +813,7 @@ #define _STL_DISABLED_WARNINGS \ 4180 4324 4412 4455 4494 4514 4574 4582 4583 4587 \ 4588 4619 4623 4625 4626 4643 4648 4702 4793 4820 \ - 4868 4988 5026 5027 5045 5220 6294 \ + 4868 4988 5026 5027 5045 5220 5246 6294 \ _STL_DISABLED_WARNING_C4577 \ _STL_DISABLED_WARNING_C4984 \ _STL_DISABLED_WARNING_C5053 \ diff --git a/tests/std/test.lst b/tests/std/test.lst index f854b83523..d52d2b4b28 100644 --- a/tests/std/test.lst +++ b/tests/std/test.lst @@ -241,6 +241,7 @@ tests\GH_004129_conversion_in_new_numeric_algorithms tests\GH_004201_chrono_formatter tests\GH_004275_seeking_fancy_iterators tests\GH_004388_unordered_meow_operator_equal +tests\GH_004477_mdspan_warning_5246 tests\LWG2381_num_get_floating_point tests\LWG2597_complex_branch_cut tests\LWG3018_shared_ptr_function diff --git a/tests/std/tests/GH_004477_mdspan_warning_5246/env.lst b/tests/std/tests/GH_004477_mdspan_warning_5246/env.lst new file mode 100644 index 0000000000..f19e2c8fd7 --- /dev/null +++ b/tests/std/tests/GH_004477_mdspan_warning_5246/env.lst @@ -0,0 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +RUNALL_INCLUDE ..\usual_latest_matrix.lst +RUNALL_CROSSLIST +* PM_CL="/w15246" diff --git a/tests/std/tests/GH_004477_mdspan_warning_5246/test.compile.pass.cpp b/tests/std/tests/GH_004477_mdspan_warning_5246/test.compile.pass.cpp new file mode 100644 index 0000000000..1844f28418 --- /dev/null +++ b/tests/std/tests/GH_004477_mdspan_warning_5246/test.compile.pass.cpp @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#include +#include + +using namespace std; + +// Test GH-4477 "Using std::mdspan results in multiple warnings (C5246)" +void test_gh_4477() { + array test_data{0, 1, 2, 3, 4, 5}; + mdspan> test_span(test_data.data(), 2, 3); + (void) test_span; +}