llvm-6502/include/llvm/ADT
David Blaikie d9078385de Ensure function_refs are copyable even from non-const references
A subtle bug was found where attempting to copy a non-const function_ref
lvalue would actually invoke the generic forwarding constructor (as it
was a closer match - being T& rather than the const T& of the implicit
copy constructor). In the particular case this lead to a dangling
function_ref member (since it had referenced the function_ref passed by
value to its ctor, rather than the outer function_ref that was still
alive)

SFINAE the converting constructor to not be considered if the copy
constructor is available and demonstrate that this causes the copy to
refer to the original functor, not to the function_ref it was copied
from. (without the code change, the test would fail as Y would be
referencing X and Y() would see the result of the mutation to X, ie: 2)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221753 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-12 02:06:08 +00:00
..
APFloat.h [ADT] Add an (ADL-friendly) abs free function for APFloat that returns 2014-10-10 08:27:22 +00:00
APInt.h InstCombine: Don't miscompile (x lshr C1) udiv C2 2014-10-13 21:48:30 +00:00
APSInt.h APSInt: Simplify code to reduce the number of copies. No functionality change. 2014-10-12 15:36:31 +00:00
ArrayRef.h Add conversion constructor to convert ArrayRef<T*> to ArrayRef<const T*>. Reviewed with Chandler and David Blaikie. 2014-08-29 06:01:43 +00:00
BitVector.h Attempting to fix the 64 bit bots. 2014-06-20 10:52:57 +00:00
DAGDeltaAlgorithm.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
DeltaAlgorithm.h Sort the #include lines for the include/... tree with the script. 2012-12-03 17:02:12 +00:00
DenseMap.h Fix SmallDenseMap assignment operator. 2014-08-04 22:18:25 +00:00
DenseMapInfo.h Fix integer undefined behavior due to signed left shift overflow in LLVM. 2012-08-24 23:29:28 +00:00
DenseSet.h Prune CRLF. 2014-10-27 12:37:26 +00:00
DepthFirstIterator.h Use range based for loops to avoid needing to re-mention SmallPtrSet size. 2014-08-24 23:23:06 +00:00
edit_distance.h [C++11] Replace OwningPtr with std::unique_ptr in places where it doesn't break the API. 2014-04-21 09:34:48 +00:00
EquivalenceClasses.h [C++] Use 'nullptr'. 2014-04-28 04:05:08 +00:00
FoldingSet.h Add specialization of FoldingSetTrait for std::pair. 2014-06-15 14:42:25 +00:00
GraphTraits.h
Hashing.h Using llvm::sys::swapByteOrder() for the common case of byte-swapping a value in place 2014-06-14 13:18:07 +00:00
ilist_node.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
ilist.h Delete dead code. 2014-07-29 00:38:55 +00:00
ImmutableList.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
ImmutableMap.h [C++] Use 'nullptr'. 2014-04-24 06:44:33 +00:00
ImmutableSet.h [C++] Use 'nullptr'. 2014-04-24 06:44:33 +00:00
IndexedMap.h SparseSet: Add support for key-derived indexes and arbitrary key types. 2012-04-20 20:05:28 +00:00
IntEqClasses.h
IntervalMap.h [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. 2014-04-14 00:51:57 +00:00
IntrusiveRefCntPtr.h [ADT/IntrusiveRefCntPtr] Give friend access to IntrusiveRefCntPtr<X> so the relevant move constructor can access 'Obj'. 2014-09-23 06:06:43 +00:00
iterator_range.h Reformat some stuff I missed in recent previous commits 2014-10-08 23:09:42 +00:00
iterator.h [ADT] Provide some helpful static_asserts for using operations of the 2014-04-30 00:49:32 +00:00
MapVector.h Add MapVector::rbegin(), MapVector::rend() to completment MapVector::begin(), MapVector::end(). 2014-10-27 17:20:53 +00:00
None.h Correct spelling of 'enumerator'. 2013-02-21 06:08:22 +00:00
Optional.h Add an emplace(...) method to llvm::Optional<T>. 2014-10-01 02:12:35 +00:00
PackedVector.h PackedVector: Make the BitVector implementation configurable. 2012-09-28 16:40:29 +00:00
PointerIntPair.h PointerIntPair: Avoid an (academic) case of undefined behavior in the DenseMapInfo specialization. 2014-03-15 18:10:49 +00:00
PointerUnion.h [ADT] Teach PointerUnion to support assignment directly from nullptr to 2014-04-29 00:14:27 +00:00
PostOrderIterator.h [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. 2014-04-14 00:51:57 +00:00
PriorityQueue.h Fix include guards so they exactly match file names. 2013-01-10 00:45:19 +00:00
SCCIterator.h SCC: Use the reference typedef 2014-04-25 20:52:08 +00:00
ScopedHashTable.h Prune CRLF. 2014-10-27 12:37:26 +00:00
SetOperations.h
SetVector.h [C++11] Remove the completely unnecessary requirement on SetVector's 2014-03-03 19:28:52 +00:00
SmallBitVector.h Prune CRLF. 2014-10-27 12:37:26 +00:00
SmallPtrSet.h Prevent use of the implicit copy constructor on SmallPtrSetImpl. An accidental copy caused my SmallPtrSet->SmallPtrSetImpl conversion commit to fail the other day. 2014-08-19 06:57:14 +00:00
SmallSet.h The count() function for STL datatypes returns unsigned, even where it's 2014-06-20 10:26:56 +00:00
SmallString.h Revert "Clean up SmallString a bit" 2014-03-09 06:22:58 +00:00
SmallVector.h house cleaning: "Don’t duplicate function or class name at the beginning of the comment." 2014-09-03 20:08:51 +00:00
SparseBitVector.h Prune CRLF. 2014-10-27 12:37:26 +00:00
SparseMultiSet.h Prune CRLF. 2014-10-27 12:37:26 +00:00
SparseSet.h Prune CRLF. 2014-10-27 12:37:26 +00:00
Statistic.h Use 'false' for a bool instead of '0' 2014-04-07 06:59:39 +00:00
STLExtras.h Ensure function_refs are copyable even from non-const references 2014-11-12 02:06:08 +00:00
StringExtras.h ADT: Surface LowerCase argument for utohexstr 2014-07-14 21:56:54 +00:00
StringMap.h Recommit 211309 (StringMap::insert), reverted in 211328 due to issues with private, but non-deleted, move members. 2014-06-23 18:28:53 +00:00
StringRef.h Solve Visual C++ warning C4805 on getAsInteger<bool>. 2014-10-04 19:58:30 +00:00
StringSet.h [ADT] Fix StringSet::insert() to not allocate on every lookup. 2013-03-15 20:16:59 +00:00
StringSwitch.h [C++11] Make use of 'nullptr' in the Support library. 2014-04-07 04:17:22 +00:00
TinyPtrVector.h Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created. 2014-08-27 05:25:25 +00:00
Triple.h Add hsail and amdil64 to Triple 2014-09-19 19:52:11 +00:00
Twine.h Fix typo in comment 2014-10-03 11:55:31 +00:00
UniqueVector.h IR: Add COMDATs to the IR 2014-06-27 18:19:56 +00:00
VariadicFunction.h Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created. 2014-08-27 05:25:25 +00:00