From bd680139d084b673d1f56d0e63e01936c4680a91 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 1 Jul 2022 16:31:47 -0700 Subject: update libcxx to llvm 14.0.6 --- lib/libcxx/src/experimental/memory_resource.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/libcxx/src/experimental/memory_resource.cpp') diff --git a/lib/libcxx/src/experimental/memory_resource.cpp b/lib/libcxx/src/experimental/memory_resource.cpp index ffe8021514..018d015928 100644 --- a/lib/libcxx/src/experimental/memory_resource.cpp +++ b/lib/libcxx/src/experimental/memory_resource.cpp @@ -1,4 +1,4 @@ -//===------------------------ memory_resource.cpp -------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -76,7 +76,9 @@ union ResourceInitHelper { ~ResourceInitHelper() {} }; -_LIBCPP_SAFE_STATIC ResourceInitHelper res_init _LIBCPP_INIT_PRIORITY_MAX; +// Pretend we're inside a system header so the compiler doesn't flag the use of the init_priority +// attribute with a value that's reserved for the implementation (we're the implementation). +#include "memory_resource_init_helper.h" } // end namespace @@ -95,8 +97,7 @@ static memory_resource * __default_memory_resource(bool set = false, memory_resource * new_res = nullptr) noexcept { #ifndef _LIBCPP_HAS_NO_ATOMIC_HEADER - _LIBCPP_SAFE_STATIC static atomic __res = - ATOMIC_VAR_INIT(&res_init.resources.new_delete_res); + _LIBCPP_SAFE_STATIC static atomic __res{&res_init.resources.new_delete_res}; if (set) { new_res = new_res ? new_res : new_delete_resource(); // TODO: Can a weaker ordering be used? -- cgit v1.2.3