commit | 94c47dd3da78ff8d529b14e9029c54710ae5162f | [log] [tgz] |
---|---|---|
author | Primiano Tucci <primiano@google.com> | Tue Oct 01 10:56:39 2019 +0100 |
committer | Primiano Tucci <primiano@google.com> | Tue Oct 01 10:56:39 2019 +0100 |
tree | e5a38bb703d4aeffddad6d9ab21026e3ab09616c | |
parent | cc55bdc0a75eea863c1a84ff83ad14e011e2bd18 [diff] [blame] |
Use explicit moves when returning covariant std::unique_ptr In C++11 gcc and clang don't agree on whether the return statement needs a std::move when returning a covariant unique_ptr (i.e. the function signature expects a unique_ptr<Base> and we try to return an instance of unique_ptr<Derived>). Fix the problem by making the cast+move explicit. See discussion in https://android-review.googlesource.com/c/platform/external/perfetto/+/1127105 Bug: 141319349 Change-Id: Iffc4fc7f76f292614a22501a151837856a0cdb90
diff --git a/src/traced/probes/probes_producer.cc b/src/traced/probes/probes_producer.cc index 3e08d6c..c73cded 100644 --- a/src/traced/probes/probes_producer.cc +++ b/src/traced/probes/probes_producer.cc
@@ -262,7 +262,7 @@ "already in use)"); return nullptr; } - return std::move(data_source); + return std::unique_ptr<ProbesDataSource>(std::move(data_source)); } std::unique_ptr<ProbesDataSource> ProbesProducer::CreateInodeFileDataSource(