Prevent at compile time converting from Error::success() to Expected<T>

This would trigger an assertion at runtime otherwise.

Differential Revision: https://reviews.llvm.org/D26482

llvm-svn: 286562
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index f0494a8..49733a5 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -2672,7 +2672,7 @@
     response.GetEscapedBinaryData(output);
     if (command_output)
       command_output->assign(output);
-    return Error::success();
+    return Error();
   }
   return Error("unable to send packet");
 }
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 440651f..0897611 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -197,13 +197,13 @@
                  __FUNCTION__);
 
   m_process_launch_info.SetArguments(const_cast<const char **>(args), true);
-  return Error::success();
+  return Error();
 }
 
 Error GDBRemoteCommunicationServerLLGS::SetLaunchFlags(
     unsigned int launch_flags) {
   m_process_launch_info.GetFlags().Set(launch_flags);
-  return Error::success();
+  return Error();
 }
 
 Error GDBRemoteCommunicationServerLLGS::LaunchProcess() {
@@ -988,7 +988,7 @@
     return error;
   }
 
-  return Error::success();
+  return Error();
 }
 
 void GDBRemoteCommunicationServerLLGS::StartSTDIOForwarding() {
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 07d3080..c0fbccb 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1252,7 +1252,7 @@
   m_continue_S_tids.clear();
   m_jstopinfo_sp.reset();
   m_jthreadsinfo_sp.reset();
-  return Error::success();
+  return Error();
 }
 
 Error ProcessGDBRemote::DoResume() {
@@ -3246,7 +3246,7 @@
     const ProcessInfo &process_info) {
   // Make sure we aren't already connected?
   if (m_gdb_comm.IsConnected())
-    return Error::success();
+    return Error();
 
   PlatformSP platform_sp(GetTarget().GetPlatform());
   if (platform_sp && !platform_sp->IsHost())
@@ -4408,7 +4408,7 @@
 
     XMLNode root_element = doc.GetRootElement("library-list-svr4");
     if (!root_element)
-      return Error::success();
+      return Error();
 
     // main link map structure
     llvm::StringRef main_lm = root_element.GetAttributeValue("main-lm");
@@ -4494,7 +4494,7 @@
 
     XMLNode root_element = doc.GetRootElement("library-list");
     if (!root_element)
-      return Error::success();
+      return Error();
 
     root_element.ForEachChildElementWithName(
         "library", [log, &list](const XMLNode &library) -> bool {
@@ -4538,7 +4538,7 @@
     return Error(0, ErrorType::eErrorTypeGeneric);
   }
 
-  return Error::success();
+  return Error();
 }
 
 lldb::ModuleSP ProcessGDBRemote::LoadModuleAtAddress(const FileSpec &file,
@@ -4662,7 +4662,7 @@
       // The file is not loaded into the inferior
       is_loaded = false;
       load_addr = LLDB_INVALID_ADDRESS;
-      return Error::success();
+      return Error();
     }
 
     return Error(
@@ -4672,7 +4672,7 @@
   if (response.IsNormalResponse()) {
     is_loaded = true;
     load_addr = response.GetHexMaxU64(false, LLDB_INVALID_ADDRESS);
-    return Error::success();
+    return Error();
   }
 
   return Error("Unknown error happened during sending the load address packet");