[llvm] [Support] Insertion operator should be forwarded, not moved (PR #152326)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 6 08:35:31 PDT 2025
https://github.com/AZero13 created https://github.com/llvm/llvm-project/pull/152326
It is a forwarding reference, after all.
>From 7f0f3b0350f62974644359fc1342f93ae81ff2ae Mon Sep 17 00:00:00 2001
From: AZero13 <gfunni234 at gmail.com>
Date: Wed, 6 Aug 2025 11:35:17 -0400
Subject: [PATCH] [Support] Insertion operator should be forwarded, not moved
It is a forwarding reference, after all.
---
llvm/include/llvm/Support/raw_ostream.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
index f87344e860518..01e4a1de86495 100644
--- a/llvm/include/llvm/Support/raw_ostream.h
+++ b/llvm/include/llvm/Support/raw_ostream.h
@@ -426,7 +426,7 @@ std::enable_if_t<!std::is_reference_v<OStream> &&
OStream &&>
operator<<(OStream &&OS, const T &Value) {
OS << Value;
- return std::move(OS);
+ return std::forward<OStream>(OS);
}
/// An abstract base class for streams implementations that also support a
More information about the llvm-commits
mailing list