diff --git a/.clang-tidy b/.clang-tidy index 41f9b2bcf7..94ac77fc9b 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,14 +1,21 @@ --- Checks: > -*, + bugprone-shared-ptr-array-mismatch, bugprone-sizeof-expression, + bugprone-string-constructor, + bugprone-suspicious-memory-comparison, + bugprone-suspicious-memset-usage, + bugprone-suspicious-semicolon, bugprone-suspicious-string-compare, + bugprone-unique-ptr-array-mismatch, bugprone-use-after-move, modernize-use-auto, modernize-use-equals-default, modernize-use-override, modernize-use-using, performance-for-range-copy, + performance-move-const-arg, readability-container-contains, readability-const-return-type, readability-container-size-empty, diff --git a/cmake/FlowCommands.cmake b/cmake/FlowCommands.cmake index acc81ea1cd..d292163026 100644 --- a/cmake/FlowCommands.cmake +++ b/cmake/FlowCommands.cmake @@ -330,6 +330,9 @@ function(add_flow_target) set_property(TARGET ${AFT_NAME} PROPERTY SOURCE_FILES ${AFT_SRCS}) set_property(TARGET ${AFT_NAME} PROPERTY HEADER_FILES ${HEADER_LIST}) set_property(TARGET ${AFT_NAME} PROPERTY COVERAGE_FILTERS ${AFT_SRCS}) + if(generated_files) + set_source_files_properties(${generated_files} PROPERTIES SKIP_LINTING ON) + endif() add_custom_target(${AFT_NAME}_actors DEPENDS ${generated_files}) if(TARGET fdboptions AND NOT "${AFT_NAME}" STREQUAL "fdboptions") diff --git a/contrib/crc32/CMakeLists.txt b/contrib/crc32/CMakeLists.txt index 0aa4f9c046..ee366527f9 100644 --- a/contrib/crc32/CMakeLists.txt +++ b/contrib/crc32/CMakeLists.txt @@ -1,4 +1,5 @@ add_library(crc32 STATIC crc32.S crc32_wrapper.c crc32c.cpp) +set_target_properties(crc32 PROPERTIES C_CLANG_TIDY "" CXX_CLANG_TIDY "") if (CLANG) # This is necessary for clang since the compiler reports that crc32_align is # defined but not used. With -Werror, crc32 will not compile. diff --git a/contrib/libb64/CMakeLists.txt b/contrib/libb64/CMakeLists.txt index 1ef665f079..f721cf0030 100644 --- a/contrib/libb64/CMakeLists.txt +++ b/contrib/libb64/CMakeLists.txt @@ -1,2 +1,3 @@ add_library(libb64 STATIC cdecode.c cencode.c) +set_target_properties(libb64 PROPERTIES C_CLANG_TIDY "") target_include_directories(libb64 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") diff --git a/contrib/md5/CMakeLists.txt b/contrib/md5/CMakeLists.txt index 317065b5c1..f2b8909038 100644 --- a/contrib/md5/CMakeLists.txt +++ b/contrib/md5/CMakeLists.txt @@ -1,2 +1,3 @@ add_library(md5 STATIC md5.c) +set_target_properties(md5 PROPERTIES C_CLANG_TIDY "") target_include_directories(md5 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") diff --git a/documentation/sphinx/source/clang-tidy.rst b/documentation/sphinx/source/clang-tidy.rst index 145a7209bb..2604a79ed2 100644 --- a/documentation/sphinx/source/clang-tidy.rst +++ b/documentation/sphinx/source/clang-tidy.rst @@ -10,13 +10,13 @@ This guide explains how to run ``clang-tidy`` locally so you can fix issues befo What clang-tidy checks ====================== -FoundationDB enables 13 checks configured in the ``.clang-tidy`` file at the repository root. The +FoundationDB enables 21 checks configured in the ``.clang-tidy`` file at the repository root. The intent is to enable more as we go forward. Here are some example rules: -* **3 Bugprone rules** -- catch potential runtime errors (e.g., ``bugprone-use-after-move``) +* **9 Bugprone rules** -- catch potential runtime errors (e.g., ``bugprone-use-after-move``, ``bugprone-suspicious-memory-comparison``) * **4 Modernize rules** -- encourage modern C++ practices (e.g., ``modernize-use-auto``, ``modernize-use-override``) -* **1 Performance rule** -- avoid unnecessary copies (``performance-for-range-copy``) -* **5 Readability rules** -- improve code clarity (e.g., ``readability-container-contains``, ``readability-container-size-empty``) +* **2 Performance rules** -- avoid unnecessary copies and pointless moves (e.g., ``performance-for-range-copy``, ``performance-move-const-arg``) +* **6 Readability rules** -- improve code clarity (e.g., ``readability-container-contains``, ``readability-container-size-empty``) Basic examples of ``clang-tidy`` style and performance improvement changes: @@ -168,7 +168,9 @@ Optional CMake variables: Known limitations ----------------- -**``.actor.cpp`` files cannot be analyzed.** These files use FoundationDB's custom actor compiler syntax (``ACTOR``, ``wait()``, ``state``) that ``clang-tidy`` cannot parse. Exclude them from your diff when running locally: +**``.actor.cpp`` files cannot be analyzed.** These files use FoundationDB's custom actor compiler syntax (``ACTOR``, ``wait()``, ``state``) that ``clang-tidy`` cannot parse. CMake skips clang-tidy for generated ``.actor.g.cpp`` outputs. Exclude actor inputs from your diff when running locally. + +Build-integrated clang-tidy also skips bundled external-library targets, including ``crc32``, ``libb64``, ``md5``, ``libeio``, and ``libcoroutine``. Quick reference =============== diff --git a/fdbclient/BackupContainerFileSystem.cpp b/fdbclient/BackupContainerFileSystem.cpp index 69f38f7618..8d8fd9b63b 100644 --- a/fdbclient/BackupContainerFileSystem.cpp +++ b/fdbclient/BackupContainerFileSystem.cpp @@ -196,7 +196,7 @@ public: json_spirit::mValue json; JSONDoc doc(json); - doc.create("files") = std::move(fileArray); + doc.create("files") = fileArray; doc.create("totalBytes") = totalBytes; doc.create("beginVersion") = minVer; doc.create("endVersion") = maxVer; @@ -1026,7 +1026,7 @@ public: std::vector toDelete; // Move filenames out of vector then destroy it to save memory - for (auto const& f : logs) { + for (auto& f : logs) { // We may have cleared the last log file earlier so skip any empty filenames if (!f.fileName.empty()) { toDelete.push_back(std::move(f.fileName)); @@ -1035,7 +1035,7 @@ public: logs.clear(); // Move filenames out of vector then destroy it to save memory - for (auto const& f : ranges) { + for (auto& f : ranges) { // The file version must be checked here again because it is likely that expireEndVersion is in the middle // of a log file, in which case after the log and range file listings are done (using the original // expireEndVersion) the expireEndVersion will be moved back slightly to the begin version of the last log @@ -1046,7 +1046,7 @@ public: } ranges.clear(); - for (auto const& f : desc.snapshots) { + for (auto& f : desc.snapshots) { if (f.endVersion < expireEndVersion) toDelete.push_back(std::move(f.fileName)); } @@ -1677,8 +1677,8 @@ Future> BackupContainerFileSystem::listRangeFiles(Version }); return map(success(oldFiles) && success(newFiles), [=](Void _) { - std::vector results = std::move(newFiles.get()); - std::vector oldResults = std::move(oldFiles.get()); + std::vector results = newFiles.get(); + std::vector oldResults = oldFiles.get(); results.insert( results.end(), std::make_move_iterator(oldResults.begin()), std::make_move_iterator(oldResults.end())); return results; diff --git a/fdbclient/DataDistributionConfig.cpp b/fdbclient/DataDistributionConfig.cpp index 43d3302daa..b090a483f5 100644 --- a/fdbclient/DataDistributionConfig.cpp +++ b/fdbclient/DataDistributionConfig.cpp @@ -44,7 +44,7 @@ json_spirit::mValue DDConfiguration::toJSON(RangeConfigMapSnapshot const& config range["begin"] = rv.range().begin.toString(); range["end"] = rv.range().end.toString(); range["configuration"] = rv.value().toJSON(); - ranges.push_back(std::move(range)); + ranges.push_back(range); } } diff --git a/fdbclient/TagThrottle.cpp b/fdbclient/TagThrottle.cpp index 4fa35d53dc..d5b931b420 100644 --- a/fdbclient/TagThrottle.cpp +++ b/fdbclient/TagThrottle.cpp @@ -37,7 +37,7 @@ void TagSet::addTag(TransactionTagRef tag) { TransactionTagRef tagRef(arena, tag); auto it = find(tags.begin(), tags.end(), tagRef); if (it == tags.end()) { - tags.push_back(std::move(tagRef)); + tags.push_back(tagRef); bytes += tag.size(); } } diff --git a/fdbclient/WriteMap.cpp b/fdbclient/WriteMap.cpp index ca0ad365f2..522c4413b4 100644 --- a/fdbclient/WriteMap.cpp +++ b/fdbclient/WriteMap.cpp @@ -156,7 +156,7 @@ void WriteMap::mutate(KeyRef key, MutationRef::Type operation, ValueRef param, b writes, ver, e.key); // FIXME: Make PTreeImpl::insert do this automatically (see also VersionedMap.h FIXME) - PTreeImpl::insert(writes, ver, std::move(e)); + PTreeImpl::insert(writes, ver, e); } } } @@ -331,7 +331,7 @@ void WriteMap::addConflictRange(KeyRangeRef keys) { } for (int i = 0; i < insertions.size(); i++) { - PTreeImpl::insert(writes, ver, std::move(insertions[i])); + PTreeImpl::insert(writes, ver, insertions[i]); } } diff --git a/fdbrpc/CMakeLists.txt b/fdbrpc/CMakeLists.txt index bb8494ca1d..fece05ba6c 100644 --- a/fdbrpc/CMakeLists.txt +++ b/fdbrpc/CMakeLists.txt @@ -37,6 +37,7 @@ target_link_libraries(fdbrpc_test PRIVATE "$" if(COMPILE_EIO) add_library(eio STATIC libeio/eio.c) + set_target_properties(eio PROPERTIES C_CLANG_TIDY "") if(USE_VALGRIND) target_link_libraries(eio PUBLIC valgrind) endif() @@ -53,6 +54,7 @@ if(${COROUTINE_IMPL} STREQUAL libcoro) list(APPEND CORO_SRCS libcoroutine/context.c) endif() add_library(coro STATIC ${CORO_SRCS}) + set_target_properties(coro PROPERTIES C_CLANG_TIDY "") target_link_libraries(coro PRIVATE flow) target_include_directories(coro PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libcoroutine) if(WIN32) diff --git a/fdbrpc/IPAllowList.cpp b/fdbrpc/IPAllowList.cpp index e80d10ee9a..a76a72e858 100644 --- a/fdbrpc/IPAllowList.cpp +++ b/fdbrpc/IPAllowList.cpp @@ -180,7 +180,7 @@ IPAddress parseAddr(std::string const& str) { struct SubNetTest { AuthAllowedSubnet subnet; - explicit SubNetTest(AuthAllowedSubnet&& subnet) : subnet(std::move(subnet)) {} + explicit SubNetTest(AuthAllowedSubnet&& subnet) : subnet(subnet) {} explicit SubNetTest(AuthAllowedSubnet const& subnet) : subnet(subnet) {} template static SubNetTest randomSubNetImpl() { diff --git a/fdbserver/clustercontroller/Status.cpp b/fdbserver/clustercontroller/Status.cpp index 5604f7c5b6..13c8af953c 100644 --- a/fdbserver/clustercontroller/Status.cpp +++ b/fdbserver/clustercontroller/Status.cpp @@ -605,7 +605,7 @@ struct RolesInfo { rocksdbMetricsObj.setKeyRawNumber("throttled_commits", rocksdbMetrics.getValue("CommitDelayed")); rocksdbMetricsObj.setKeyRawNumber("write_stall_microseconds", rocksdbMetrics.getValue("StallMicros")); - obj["rocksdb_metrics"] = std::move(rocksdbMetricsObj); + obj["rocksdb_metrics"] = rocksdbMetricsObj; } } catch (AttributeNotFoundError& e) { @@ -3444,7 +3444,7 @@ AsyncResult clusterGetStatus( delay(deadlineTimeout)); if (result.index() == 0) { - ErrorOr statusResult = std::get<0>(std::move(result)); + ErrorOr statusResult = std::get<0>(result); if (statusResult.isError()) { status_incomplete_reasons.insert( fmt::format("Status collection threw: {}", statusResult.getError().what())); diff --git a/fdbserver/commitproxy/CommitProxyServer.cpp b/fdbserver/commitproxy/CommitProxyServer.cpp index 94a074dbc1..717f53a29e 100644 --- a/fdbserver/commitproxy/CommitProxyServer.cpp +++ b/fdbserver/commitproxy/CommitProxyServer.cpp @@ -1807,7 +1807,7 @@ Future transactionLogging(CommitBatchContext* self) { auto res = co_await race(self->loggingComplete, pProxyCommitData->committedVersion.whenAtLeast(self->commitVersion + 1)); if (res.index() == 0) { - Version ver = std::get<0>(std::move(res)); + Version ver = std::get<0>(res); if (!SERVER_KNOBS->ENABLE_VERSION_VECTOR_TLOG_UNICAST) { pProxyCommitData->minKnownCommittedVersion = std::max(pProxyCommitData->minKnownCommittedVersion, ver); } diff --git a/fdbserver/coordinator/OnDemandStore.cpp b/fdbserver/coordinator/OnDemandStore.cpp index fd4258724d..3c4898db04 100644 --- a/fdbserver/coordinator/OnDemandStore.cpp +++ b/fdbserver/coordinator/OnDemandStore.cpp @@ -21,7 +21,7 @@ #include "OnDemandStore.h" static Future onErr(Future> e) { - Future f = co_await std::move(e); + Future f = co_await e; co_await f; } diff --git a/fdbserver/core/StorageMetrics.cpp b/fdbserver/core/StorageMetrics.cpp index 5658a54e58..292872baa5 100644 --- a/fdbserver/core/StorageMetrics.cpp +++ b/fdbserver/core/StorageMetrics.cpp @@ -725,7 +725,7 @@ Future waitMetrics(StorageServerMetrics* self, WaitMetricsRequest req, Fut try { auto res = co_await race(change.getFuture(), timeout); if (res.index() == 0) { - metrics += std::get<0>(std::move(res)); + metrics += std::get<0>(res); } else { timedout = true; } diff --git a/fdbserver/datadistributor/DDTxnProcessor.cpp b/fdbserver/datadistributor/DDTxnProcessor.cpp index deb4aaf43e..7a4c4a83d0 100644 --- a/fdbserver/datadistributor/DDTxnProcessor.cpp +++ b/fdbserver/datadistributor/DDTxnProcessor.cpp @@ -439,7 +439,7 @@ class DDTxnProcessorImpl { for (auto& r : ranges) { ASSERT(!r.value()->valid); } - result->dataMoveMap.insert(meta.ranges.front(), std::move(dataMove)); + result->dataMoveMap.insert(meta.ranges.front(), dataMove); ++numDataMoves; } diff --git a/fdbserver/ratekeeper/Ratekeeper.cpp b/fdbserver/ratekeeper/Ratekeeper.cpp index f9c876bb22..afb5598a37 100644 --- a/fdbserver/ratekeeper/Ratekeeper.cpp +++ b/fdbserver/ratekeeper/Ratekeeper.cpp @@ -1224,7 +1224,7 @@ UpdateCommitCostRequest StorageQueueInfo::refreshCommitCost(double elapsed) { } while (!topKWriters.empty()) { - busiestWriteTags.push_back(std::move(topKWriters.top())); + busiestWriteTags.push_back(topKWriters.top()); topKWriters.pop(); } @@ -1269,7 +1269,7 @@ TLogQueueInfo::TLogQueueInfo(UID id) void TLogQueueInfo::update(TLogQueuingMetricsReply const& reply, Smoother& smoothTotalDurableBytes) { valid = true; - auto prevReply = std::move(lastReply); + auto prevReply = lastReply; lastReply = reply; if (prevReply.instanceID != reply.instanceID) { smoothDurableBytes.reset(reply.bytesDurable); diff --git a/fdbserver/storageserver/TransactionTagCounter.cpp b/fdbserver/storageserver/TransactionTagCounter.cpp index 1dd220606f..39dff64dab 100644 --- a/fdbserver/storageserver/TransactionTagCounter.cpp +++ b/fdbserver/storageserver/TransactionTagCounter.cpp @@ -51,7 +51,7 @@ class TransactionTagCounterImpl { } std::vector result; while (!topKTags.empty()) { - result.push_back(std::move(topKTags.top())); + result.push_back(topKTags.top()); topKTags.pop(); } return result; diff --git a/fdbserver/tlog/TLogServer.cpp b/fdbserver/tlog/TLogServer.cpp index 4f88f1cae8..2764c688d0 100644 --- a/fdbserver/tlog/TLogServer.cpp +++ b/fdbserver/tlog/TLogServer.cpp @@ -2626,7 +2626,7 @@ Future rejoinClusterController(TLogData* self, co_await race(brokenPromiseToNever(self->dbInfo->get().clusterInterface.tlogRejoin.getReply(req)), self->dbInfo->onChange()); if (res.index() == 0) { - TLogRejoinReply rep = std::get<0>(std::move(res)); + TLogRejoinReply rep = std::get<0>(res); if (rep.masterIsRecovered) lastMasterLifetime = self->dbInfo->get().masterLifetime; } else { diff --git a/fdbserver/tlog/TestTLogServer.cpp b/fdbserver/tlog/TestTLogServer.cpp index 814579da44..00ed45f1ca 100644 --- a/fdbserver/tlog/TestTLogServer.cpp +++ b/fdbserver/tlog/TestTLogServer.cpp @@ -114,7 +114,7 @@ struct StorageResources { StorageResources() = default; StorageResources(std::string dq, std::string kv, TempStorageFiles files) - : diskQueueFilename(std::move(dq)), kvStoreFilename(std::move(kv)), tempFiles(std::move(files)) {} + : diskQueueFilename(std::move(dq)), kvStoreFilename(std::move(kv)), tempFiles(files) {} }; StorageResources setupPersistentStorage(Reference tLogContext, @@ -134,7 +134,7 @@ StorageResources setupPersistentStorage(Reference tLogContext, TempStorageFiles tempFiles( diskQueueFilename, options.diskQueueExtension, kvStoreFilename, options.kvStoreExtension); - return StorageResources(diskQueueFilename, kvStoreFilename, std::move(tempFiles)); + return StorageResources(diskQueueFilename, kvStoreFilename, tempFiles); } Reference initTLogTestContext(TestTLogOptions tLogOptions, @@ -234,7 +234,7 @@ Future getTLogCreateActor(Reference pTLogTestContext, // wait for either test completion or tLog failure. auto choice = co_await race(tl, pTLogContext->TestTLogServerCompleted.getFuture()); if (choice.index() == 1) { - bool testCompleted = std::get<1>(std::move(choice)); + bool testCompleted = std::get<1>(choice); ASSERT_EQ(testCompleted, true); } diff --git a/fdbserver/worker/MetricClient.cpp b/fdbserver/worker/MetricClient.cpp index 2cc41cec6f..a788105dff 100644 --- a/fdbserver/worker/MetricClient.cpp +++ b/fdbserver/worker/MetricClient.cpp @@ -135,7 +135,7 @@ void UDPMetricClient::send(MetricCollection* metrics) { for (const auto& msg : metrics->statsd_message) { // Account for max udp packet size (+1 since we add '\n') if (messages.size() + msg.size() + 1 < IUDPSocket::MAX_PACKET_SIZE) { - messages += (std::move(msg) + '\n'); + messages += (msg + '\n'); } else { send_packet(socket_fd, buf.buffer.get(), buf.data_size); } diff --git a/fdbserver/workloads/AutomaticIdempotencyWorkload.cpp b/fdbserver/workloads/AutomaticIdempotencyWorkload.cpp index 02f5d1480a..abdf4dbe6a 100644 --- a/fdbserver/workloads/AutomaticIdempotencyWorkload.cpp +++ b/fdbserver/workloads/AutomaticIdempotencyWorkload.cpp @@ -479,7 +479,7 @@ struct AutomaticIdempotencyWorkload : TestWorkload { co_await race(testCleanerOneIteration(db, &actors, minAgeSeconds, maxTimestampDelta, &createdTimes), actors.getResult()); if (choice.index() == 0) { - bool done = std::get<0>(std::move(choice)); + bool done = std::get<0>(choice); if (done) { break; diff --git a/fdbserver/workloads/DcLag.cpp b/fdbserver/workloads/DcLag.cpp index 6368d5b75e..43e5bd006f 100644 --- a/fdbserver/workloads/DcLag.cpp +++ b/fdbserver/workloads/DcLag.cpp @@ -173,7 +173,7 @@ struct DcLagWorkload : TestWorkload { // Fetch DC lag every 5s status = fetchDatacenterLag(cx); } else if (choice.index() == 1) { - Optional lag = std::get<1>(std::move(choice)); + Optional lag = std::get<1>(choice); if (lag.present() && lag.get() >= SERVER_KNOBS->LOG_ROUTER_PEEK_SWITCH_DC_TIME - 10.0) { // Detect DC Lag happened before Log router switch DC reactions diff --git a/fdbserver/workloads/FailoverWithSSLag.cpp b/fdbserver/workloads/FailoverWithSSLag.cpp index df99861592..4d91a0c7b2 100644 --- a/fdbserver/workloads/FailoverWithSSLag.cpp +++ b/fdbserver/workloads/FailoverWithSSLag.cpp @@ -194,7 +194,7 @@ struct FailoverWithSSLagWorkload : TestWorkload { // Fetch SS lag every 5s. ssLag = fetchStorageServerLag(cx); } else if (choice.index() == 1) { - Optional versionLag = std::get<1>(std::move(choice)); + Optional versionLag = std::get<1>(choice); if (versionLag.present() && versionLag.get() >= SERVER_KNOBS->MAX_VERSION_DIFFERENCE) { TraceEvent("SSLag").detail("Versions", versionLag.get()); diff --git a/fdbserver/workloads/MiniCycle.cpp b/fdbserver/workloads/MiniCycle.cpp index 8d457e8e4a..3f36e94a55 100644 --- a/fdbserver/workloads/MiniCycle.cpp +++ b/fdbserver/workloads/MiniCycle.cpp @@ -85,7 +85,7 @@ struct MiniCycleWorkload : TestWorkload { while (true) { auto choice = co_await race(self->_checkCycle(cx->clone(), self, ok), end); if (choice.index() == 0) { - bool ret = std::get<0>(std::move(choice)); + bool ret = std::get<0>(choice); ok = ret && ok; if (!ok) diff --git a/fdbserver/workloads/RemoveServersSafely.cpp b/fdbserver/workloads/RemoveServersSafely.cpp index b639a2ebc0..055fa83d7d 100644 --- a/fdbserver/workloads/RemoveServersSafely.cpp +++ b/fdbserver/workloads/RemoveServersSafely.cpp @@ -612,7 +612,7 @@ struct RemoveServersSafelyWorkload : TestWorkload { { auto choice = co_await race(checkSafeExclusions(cx, toKillMarkFailedArray), delay(5.0)); if (choice.index() == 0) { - bool _safe = std::get<0>(std::move(choice)); + bool _safe = std::get<0>(choice); safe = _safe && protectServers(std::set(toKillMarkFailedArray.begin(), toKillMarkFailedArray.end())) diff --git a/flow/IndexedSet.cpp b/flow/IndexedSet.cpp index 628ee8beb3..c6060c1663 100644 --- a/flow/IndexedSet.cpp +++ b/flow/IndexedSet.cpp @@ -287,7 +287,7 @@ TEST_CASE("performance/flow/IndexedSet/integers") { double start = timer(); for (int i = 0; i < x.size(); i++) { int t = x[i]; - is.insert(std::move(t), 3); + is.insert(t, 3); } double end = timer(); double kps = x.size() / 1000.0 / (end - start); diff --git a/flow/Net2.cpp b/flow/Net2.cpp index 99ad44daaa..5d7fcead79 100644 --- a/flow/Net2.cpp +++ b/flow/Net2.cpp @@ -206,7 +206,7 @@ public: if (thread_network == this) stopCallbacks.emplace_back(std::move(fn)); else - onMainThreadVoid([this, fn] { this->stopCallbacks.emplace_back(std::move(fn)); }); + onMainThreadVoid([this, fn = std::move(fn)]() mutable { this->stopCallbacks.emplace_back(std::move(fn)); }); } bool isSimulated() const override { return false; } diff --git a/flow/ProcessEvents.cpp b/flow/ProcessEvents.cpp index 163b38fa51..f622ecb7dc 100644 --- a/flow/ProcessEvents.cpp +++ b/flow/ProcessEvents.cpp @@ -164,7 +164,7 @@ void uncancellableEvent(StringRef name, Callback callback) { } Event::Event(StringRef name, Callback callback) { - impl = new EventImpl({ std::move(name) }, std::move(callback)); + impl = new EventImpl({ name }, std::move(callback)); } Event::Event(std::vector names, Callback callback) { impl = new EventImpl(std::move(names), std::move(callback)); @@ -266,4 +266,4 @@ TEST_CASE("/flow/ProcessEvents") { return Void(); } -} // namespace ProcessEvents \ No newline at end of file +} // namespace ProcessEvents diff --git a/flow/XmlTraceLogFormatter.cpp b/flow/XmlTraceLogFormatter.cpp index dbd57acdf0..9d9e64ee5d 100644 --- a/flow/XmlTraceLogFormatter.cpp +++ b/flow/XmlTraceLogFormatter.cpp @@ -75,7 +75,7 @@ void XmlTraceLogFormatter::escape(std::ostringstream& oss, std::string source) c source = source.substr(index + 1); } - oss << std::move(source); + oss << source; } std::string XmlTraceLogFormatter::formatEvent(const TraceEventFields& fields) const {