Auto generated patch. Do not edit or delete it, even if empty. diff -ruN --strip-trailing-cr a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp --- a/clang/lib/Sema/SemaCoroutine.cpp +++ b/clang/lib/Sema/SemaCoroutine.cpp @@ -1488,6 +1488,8 @@ if (FoundAllocations) { IAP = FoundAllocations->IAP; OperatorNew = FoundAllocations->OperatorNew; + } else { + OperatorNew = nullptr; } assert(!OperatorNew || !OperatorNew->isTypeAwareOperatorNewOrDelete()); }; diff -ruN --strip-trailing-cr a/clang/test/SemaCXX/coroutine-new-operator.cpp b/clang/test/SemaCXX/coroutine-new-operator.cpp --- a/clang/test/SemaCXX/coroutine-new-operator.cpp +++ b/clang/test/SemaCXX/coroutine-new-operator.cpp @@ -0,0 +1,49 @@ +// RUN: %clang_cc1 -std=c++20 -fcoro-aligned-allocation -fsyntax-only -verify %s +// expected-no-diagnostics + +namespace std { + template + struct coroutine_traits { + using promise_type = typename R::promise_type; + }; + + template struct coroutine_handle { + coroutine_handle() = default; + static coroutine_handle from_address(void *) noexcept; + }; + template <> struct coroutine_handle { + static coroutine_handle from_address(void *) noexcept; + coroutine_handle() = default; + template + coroutine_handle(coroutine_handle) noexcept; + }; + + struct suspend_always { + bool await_ready() const noexcept { return false; } + void await_suspend(coroutine_handle<>) const noexcept {} + void await_resume() const noexcept {} + }; + + enum class align_val_t : decltype(sizeof(0)) {}; +} // namespace std + +using size_t = decltype(sizeof(0)); + +struct Task { + struct promise_type { + std::suspend_always initial_suspend() noexcept { return {}; } + std::suspend_always final_suspend() noexcept { return {}; } + void return_void() {} + void unhandled_exception() {} + Task get_return_object() noexcept { return {}; } + + void* operator new(size_t n, void* buf, size_t capacity) noexcept { + return buf; + } + void operator delete(void*) noexcept {} + }; +}; + +Task CoGetReturnAddress(void* buf, size_t capacity) { + co_return; +} diff -ruN --strip-trailing-cr a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel @@ -1467,15 +1467,12 @@ name = "__support_libc_assert", hdrs = ["src/__support/libc_assert.h"], deps = [ - ":__support_integer_to_string", ":__support_macros_attributes", ":__support_macros_config", ":__support_macros_hardening", ":__support_macros_macro_utils", ":__support_macros_optimization", ":__support_macros_properties_os", - ":__support_osutil_exit_hdrs", - ":__support_osutil_io", ], ) @@ -2741,7 +2738,7 @@ ], "@platforms//os:macos": [ "src/__support/OSUtil/darwin/syscall.h", - "src/__support/OSUtil/darwin/arm/syscall.h", + "src/__support/OSUtil/darwin/aarch64/syscall.h", ], "@platforms//os:windows": [], }), @@ -3748,6 +3745,7 @@ ":__support_libc_errno", ":__support_macros_attributes", ":__support_macros_config", + ":__support_macros_hardening", ":__support_macros_optimization", ":__support_macros_properties_architectures", ":__support_macros_properties_compiler", diff -ruN --strip-trailing-cr a/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl b/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl --- a/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl +++ b/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl @@ -61,14 +61,19 @@ else: deps = deps + ["//libc/test/UnitTest:LibcUnitTest"] + tags = kwargs.pop("tags", []) if full_build: copts = copts + _FULL_BUILD_COPTS + + # Temporarily disable full_build tests (currently broken) to unblock CI. + tags = tags + ["manual", "notap"] cc_test( name = name, local_defines = local_defines + _TEST_DEFINES + LIBC_CONFIGURE_OPTIONS, deps = deps, copts = copts + libc_common_copts(), linkstatic = 1, + tags = tags, **kwargs )