[libcxx-commits] [libcxx] [libc++][NFC] Fix unparenthesized comma expression in mem-initializer (PR #89605)
    via libcxx-commits 
    libcxx-commits at lists.llvm.org
       
    Mon Apr 22 06:37:02 PDT 2024
    
    
  
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Krystian Stasiowski (sdkrystian)
<details>
<summary>Changes</summary>
#<!-- -->84050 resolves class member access expressions naming members of the current instantiation prior to instantiation. In testing, it has revealed a mem-initializer in the move constructor of `invocable_with_telemetry` that uses an unparenthesized comma expression to initialize a non-static data member of pointer type. This patch fixes it. 
---
Full diff: https://github.com/llvm/llvm-project/pull/89605.diff
1 Files Affected:
- (modified) libcxx/test/support/invocable_with_telemetry.h (+1-1) 
``````````diff
diff --git a/libcxx/test/support/invocable_with_telemetry.h b/libcxx/test/support/invocable_with_telemetry.h
index 612bbec639d466..e010837a1624cd 100644
--- a/libcxx/test/support/invocable_with_telemetry.h
+++ b/libcxx/test/support/invocable_with_telemetry.h
@@ -31,7 +31,7 @@ class invocable_with_telemetry {
   constexpr invocable_with_telemetry(invocable_with_telemetry&& other)
     requires std::move_constructible<F>
       : f_(std::move(other.f_)),
-        telemetry_(assert(other.telemetry_ != nullptr), std::exchange(other.telemetry_, nullptr)) {
+        telemetry_((assert(other.telemetry_ != nullptr), std::exchange(other.telemetry_, nullptr))) {
     ++telemetry_->moves;
   }
 
``````````
</details>
https://github.com/llvm/llvm-project/pull/89605
    
    
More information about the libcxx-commits
mailing list