File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,20 +15,38 @@ std::shared_ptr<const SinkList> g_sinks;
1515
1616void set_diagnostic_sinks (std::span<const DiagnosticSink> sinks) noexcept {
1717 auto list = std::make_shared<SinkList>(sinks.begin (), sinks.end ());
18- std::atomic_store_explicit ( // NOLINT deprecated-declarations
18+
19+ #ifdef _MSC_VER
20+ #pragma warning(push)
21+ #pragma warning(disable : 4996)
22+ #endif
23+
24+ std::atomic_store_explicit ( // NOLINT(deprecated-declarations)
1925 &g_sinks,
2026 // the suggestion to use std::atomic::<std::shared_ptr<T>>
2127 std::shared_ptr<const SinkList>(
2228 std::move (list)), // This may not require a move
2329 std::memory_order_release);
2430 // lint from clang tidy does not work on msvc(it works on GCC, at least!), we
2531 // should look into this more! TODO
32+
33+ #ifdef _MSC_VER
34+ #pragma warning(pop)
35+ #endif
2636}
2737
2838std::shared_ptr<const SinkList> diagnostic_sinks_snapshot () noexcept {
29- // NOLINTNEXTLINE (same as above)
30- return std::atomic_load_explicit (std::addressof (g_sinks),
31- std::memory_order_acquire);
39+ #ifdef _MSC_VER
40+ #pragma warning(push)
41+ #pragma warning(disable : 4996)
42+ #endif
43+
44+ return std::atomic_load_explicit ( // NOLINT(deprecated-declarations)
45+ std::addressof (g_sinks), std::memory_order_acquire);
46+
47+ #ifdef _MSC_VER
48+ #pragma warning(pop)
49+ #endif
3250}
3351
3452void report (const DiagnosticEvent &e) noexcept {
You can’t perform that action at this time.
0 commit comments