Skip to content

Commit fa742b7

Browse files
author
deadeyegoodwin
authored
Fix build on Ubuntu 20.04 (#568)
Remove std::move in return to resolve this build failure: [ 66%] Building CXX object CMakeFiles/onnxruntime_providers.dir/workspace/onnxruntime/onnxruntime/core/providers/cpu/activation/activations.cc.o /workspace/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp: In function ‘std::vector<nvinfer1::PluginField> onnx2trt::{anonymous}::loadFields(string_map<std::vector<unsigned char> >&, const OnnxAttrs&, const nvinfer1::PluginFieldCollection*)’: /workspace/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp:3737:21: error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move] 3737 | return std::move(fields); | ~~~~~~~~~^~~~~~~~ /workspace/onnxruntime/cmake/external/onnx-tensorrt/builtin_op_importers.cpp:3737:21: note: remove ‘std::move’ call Signed-off-by: David Goodwin <davidg@nvidia.com>
1 parent 8755b5f commit fa742b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin_op_importers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3779,7 +3779,7 @@ std::vector<nvinfer1::PluginField> loadFields(string_map<std::vector<uint8_t>>&
37793779
}
37803780
fields.emplace_back(fieldName.c_str(), data, type, size);
37813781
}
3782-
return std::move(fields);
3782+
return fields;
37833783
}
37843784

37853785
// Any ops that are not supported will attempt to import as plugins.

0 commit comments

Comments
 (0)