[PATCH] D23956: Fix DensetSet::insert_as() for MSVC2015 (NFC)
Mehdi AMINI via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 26 22:30:57 PDT 2016
mehdi_amini created this revision.
mehdi_amini added reviewers: dexonsmith, chandlerc, rsmith.
mehdi_amini added a subscriber: llvm-commits.
The latest MSVC update apparently resolve the call from the
const ref variant to itself, leading to an infinite
recursion. It is not clear to me why the r-value overload is
not selected. `ValueT` is a pointer type, and the functional-style
cast in the call `insert_as(ValueT(V), LookupKey);` should result
in a r-value ref.
If anyone understand...
https://reviews.llvm.org/D23956
Files:
include/llvm/ADT/DenseSet.h
Index: include/llvm/ADT/DenseSet.h
===================================================================
--- include/llvm/ADT/DenseSet.h
+++ include/llvm/ADT/DenseSet.h
@@ -168,12 +168,11 @@
template <typename LookupKeyT>
std::pair<iterator, bool> insert_as(const ValueT &V,
const LookupKeyT &LookupKey) {
- return insert_as(ValueT(V), LookupKey);
+ return TheMap.insert_as({V, detail::DenseSetEmpty()}, LookupKey);
}
template <typename LookupKeyT>
std::pair<iterator, bool> insert_as(ValueT &&V, const LookupKeyT &LookupKey) {
- detail::DenseSetEmpty Empty;
- return TheMap.insert_as(std::make_pair(std::move(V), Empty), LookupKey);
+ return TheMap.insert_as({std::move(V), detail::DenseSetEmpty()}, LookupKey);
}
// Range insertion of values.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23956.69472.patch
Type: text/x-patch
Size: 820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160827/67cf8e63/attachment.bin>
More information about the llvm-commits
mailing list