From 86a15b266a7284f3aa1b12494a475f31416b981d Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 12 Jul 2022 20:18:56 -0400 Subject: libcpp: Avoid pessimizing std::move [PR106272] std::move in a return statement can prevent the NRVO: PR106272 reports that we have two such cases in class label_text's member functions. We have -Wpessimizing-move that's supposed to detect problematic std::move uses, but in this case it didn't trigger. I've filed PR106276 to track that. PR preprocessor/106272 libcpp/ChangeLog: * include/line-map.h (class label_text): Don't std::move in a return statement. --- libcpp/include/line-map.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libcpp') diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h index c6379ce..c434a24 100644 --- a/libcpp/include/line-map.h +++ b/libcpp/include/line-map.h @@ -1873,13 +1873,13 @@ public: longer-lived owner. */ static label_text borrow (const char *buffer) { - return std::move (label_text (const_cast (buffer), false)); + return label_text (const_cast (buffer), false); } /* Create a label_text instance that takes ownership of BUFFER. */ static label_text take (char *buffer) { - return std::move (label_text (buffer, true)); + return label_text (buffer, true); } /* Take ownership of the buffer, copying if necessary. */ -- cgit v1.1 From cff72485b1d5682a0c55f45b6e6f023c98739862 Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 14 Jul 2022 00:16:48 +0000 Subject: Daily bump. --- libcpp/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libcpp') diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 1a211f32..fe02298 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,9 @@ +2022-07-13 Marek Polacek + + PR preprocessor/106272 + * include/line-map.h (class label_text): Don't std::move in a return + statement. + 2022-07-10 Lewis Hyatt PR preprocessor/97498 -- cgit v1.1