steakhal wrote:
> I can't build it on SLES15:
>
> ```
> 21:10:55 /usr/include/c++/7/bits/stl_map.h:199:7: required from
> 'llvm::Expected<T>::Expected(OtherT&&, std::enable_if_t<is_convertible_v<U,
> T> >*) [with OtherT = clang::ssaf::SummaryDataStore&; T =
> clang::ssaf::SummaryDataStore; std::enable_if_t<is_convertible_v<U, T> > =
> void]'
> 21:10:55
> /workspace/src/clang/lib/ScalableStaticAnalysisFramework/Core/SummaryData/LUSummaryConsumer.cpp:58:10:
> required from here
> 21:10:55 /usr/include/c++/7/ext/new_allocator.h:136:4: error: use of deleted
> function 'std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 =
> const clang::ssaf::SummaryName; _T2 =
> std::unique_ptr<clang::ssaf::SummaryData>]'
> ```
>
> Is there anything that can be done to make it build on the still supported
> Linux distribution with an ancient version of libstdc++?
This must be the broken NRVO case with gcc-7. Yes, there is. Actually the fix
is really easy, we should just pessimise the return expression by explicitly
`std::move`-ing the expression that gets returned.
Could you please check if applying this diff would resolve this, or there is
any other return statement that would need to be adapted as well: @pawosm-arm
```diff
diff --git
a/clang/lib/ScalableStaticAnalysisFramework/Core/SummaryData/LUSummaryConsumer.cpp
b/clang/lib/ScalableStaticAnalysisFramework/Core/SummaryData/LUSummaryConsumer.cpp
index e6f21d8c5479..79b1e23bdd9e 100644
---
a/clang/lib/ScalableStaticAnalysisFramework/Core/SummaryData/LUSummaryConsumer.cpp
+++
b/clang/lib/ScalableStaticAnalysisFramework/Core/SummaryData/LUSummaryConsumer.cpp
@@ -55,7 +55,7 @@ LUSummaryConsumer::run(llvm::ArrayRef<SummaryName> Names) {
}
Store.Data.emplace(SN, std::move(*Result));
}
- return Store;
+ return std::move(Store);
}
SummaryDataStore LUSummaryConsumer::run() && {
```
https://github.com/llvm/llvm-project/pull/186156
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits