Skip to content

Conversation

vitalybuka
Copy link
Collaborator

Reverts #77394

@vitalybuka vitalybuka requested a review from a team as a code owner January 18, 2024 23:42
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jan 18, 2024
@llvmbot
Copy link
Member

llvmbot commented Jan 18, 2024

@llvm/pr-subscribers-libcxx

Author: Vitaly Buka (vitalybuka)

Changes

Reverts llvm/llvm-project#77394


Full diff: https://github.com/llvm/llvm-project/pull/78646.diff

1 Files Affected:

  • (modified) libcxx/include/string (+1-1)
diff --git a/libcxx/include/string b/libcxx/include/string
index 4116f350a80476..ecafb80a79a3a2 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -921,7 +921,7 @@ public:
       // Turning off ASan instrumentation for variable initialization with _LIBCPP_STRING_INTERNAL_MEMORY_ACCESS
       // does not work consistently during initialization of __r_, so we instead unpoison __str's memory manually first.
       // __str's memory needs to be unpoisoned only in the case where it's a short string.
-      : __r_([](basic_string &__s) -> decltype(__s.__r_)&& { if(!__s.__is_long()) __s.__annotate_delete(); return std::move(__s.__r_); }(__str)) {
+      : __r_(((__str.__is_long() ? 0 : (__str.__annotate_delete(), 0)), std::move(__str.__r_))) {
     __str.__r_.first() = __rep();
     __str.__annotate_new(0);
     if (!__is_long())

@ldionne
Copy link
Member

ldionne commented Jan 22, 2024

@vitalybuka Does this still serve a purpose being open?

@ldionne
Copy link
Member

ldionne commented Jan 23, 2024

I'll tentatively close, please reopen if this serves a purpose. I think it's safe to close since the short string annotations have landed and issues have been handled.

@ldionne ldionne closed this Jan 23, 2024
@vitalybuka
Copy link
Collaborator Author

Thanks, that's not needed anymore.

@nunoplopes nunoplopes deleted the revert-77394-lambda-fixed branch December 28, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants