llvm-6502/unittests
David Blaikie 38a4f3bbec Ensure ErrorOr cannot implicitly invoke explicit ctors of the underlying type.
An unpleasant surprise while migrating unique_ptrs (see changes in
lib/Object): ErrorOr<int*> was implicitly convertible to
ErrorOr<std::unique_ptr<int>>.

Keep the explicit conversions otherwise it's a pain to convert
ErrorOr<int*> to ErrorOr<std::unique_ptr<int>>.

I'm not sure if there should be more SFINAE on those explicit ctors (I
could check if !is_convertible && is_constructible, but since the ctor
has to be called explicitly I don't think there's any need to disable
them when !is_constructible - they'll just fail anyway. It's the
converting ctors that can create interesting ambiguities without proper
SFINAE). I had to SFINAE the explicit ones because otherwise they'd be
ambiguous with the implicit ones in an explicit context, so far as I
could tell.

The converting assignment operators seemed unnecessary (and similarly
buggy/dangerous) - just rely on the converting ctors to convert to the
right type for assignment instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217048 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 17:31:25 +00:00
..
ADT Add some negative (and positive) static_assert checks for ArrayRef-of-pointer conversions introduced in r216709 2014-08-31 01:33:41 +00:00
Analysis Modernize the .ll parsing interface. 2014-08-19 16:58:54 +00:00
Bitcode Return a std::unique_ptr when creating a new MemoryBuffer. 2014-08-27 20:03:13 +00:00
CodeGen DIE: Pass ownership of children via std::unique_ptr rather than raw pointer. 2014-04-25 20:00:34 +00:00
DebugInfo [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt. 2013-12-10 11:13:32 +00:00
ExecutionEngine Reinstate "Nuke the old JIT." 2014-09-02 22:28:02 +00:00
IR Fix a logic bug when copying fast-math flags. 2014-09-02 20:03:00 +00:00
LineEditor [CMake] LineEditorTests: Add Support to link_components. 2014-07-24 11:44:33 +00:00
Linker [C++11] Use 'nullptr'. 2014-06-08 22:29:17 +00:00
MC Nuke MCAnalysis. 2014-09-02 22:32:20 +00:00
Option Retire llvm::array_endof in favor of non-member std::end. 2014-04-12 16:15:53 +00:00
Support Ensure ErrorOr cannot implicitly invoke explicit ctors of the underlying type. 2014-09-03 17:31:25 +00:00
Transforms [Debug Info] add DISubroutineType and its creation takes DITypeArray. 2014-07-28 22:24:06 +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 With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore. 2014-02-28 16:16:51 +00:00