llvm-6502/unittests
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
..
ADT Ensure function_refs are copyable even from non-const references 2014-11-12 02:06:08 +00:00
Analysis Silence gcc's -Wcomment 2014-10-22 02:16:06 +00:00
Bitcode Modernize the error handling of the Materialize function. 2014-10-24 22:50:48 +00:00
CodeGen
DebugInfo
ExecutionEngine [MCJIT] Make repeat calls to MCJIT::getPointerToFunction for declarations safe. 2014-10-22 23:18:42 +00:00
IR Add unittest for extreme alignments. 2014-10-23 14:45:19 +00:00
LineEditor [CMake] LineEditorTests: Add Support to link_components. 2014-07-24 11:44:33 +00:00
Linker Remove the PreserveSource linker mode. 2014-10-28 00:24:16 +00:00
MC [Hexagon] Reverting 220584 to address ASAN errors. 2014-11-04 00:14:36 +00:00
Option
Support [CMake] LLVMSupport: Give system_libs PRIVATE scope when LLVMSupport is built as SHARED. Users of LLVMSupport won't inherit ${system_libs}. 2014-11-07 16:08:19 +00:00
Transforms Move the complex address expression out of DIVariable and into an extra 2014-10-01 18:55:02 +00:00
CMakeLists.txt Invert the MC -> Object dependency. 2014-07-03 02:01:39 +00:00
Makefile Invert the MC -> Object dependency. 2014-07-03 02:01:39 +00:00
Makefile.unittest