Skip to content

[LLVM][Support] Fixed the compile error caused by #73603 #75418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

shiltian
Copy link
Contributor

This patch fixed the following compile error caused by #73603.

llvm/lib/Support/raw_ostream.cpp: In static member function ‘static llvm::Expected<llvm::ListeningSocket> llvm::ListeningSocket::createUnix(llvm::StringRef, int)’:
llvm/lib/Support/raw_ostream.cpp:1040:10: error: could not convert ‘ListenSocket’ from ‘llvm::ListeningSocket’ to ‘llvm::Expected<llvm::ListeningSocket>’
   return ListenSocket;
          ^~~~~~~~~~~~

This patch fixed the following compile error caused by llvm#73603.

```
llvm/lib/Support/raw_ostream.cpp: In static member function ‘static llvm::Expected<llvm::ListeningSocket> llvm::ListeningSocket::createUnix(llvm::StringRef, int)’:
llvm/lib/Support/raw_ostream.cpp:1040:10: error: could not convert ‘ListenSocket’ from ‘llvm::ListeningSocket’ to ‘llvm::Expected<llvm::ListeningSocket>’
   return ListenSocket;
          ^~~~~~~~~~~~
```
@llvmbot
Copy link
Member

llvmbot commented Dec 14, 2023

@llvm/pr-subscribers-llvm-support

Author: Shilei Tian (shiltian)

Changes

This patch fixed the following compile error caused by #73603.

llvm/lib/Support/raw_ostream.cpp: In static member function ‘static llvm::Expected&lt;llvm::ListeningSocket&gt; llvm::ListeningSocket::createUnix(llvm::StringRef, int)’:
llvm/lib/Support/raw_ostream.cpp:1040:10: error: could not convert ‘ListenSocket’ from ‘llvm::ListeningSocket’ to ‘llvm::Expected&lt;llvm::ListeningSocket&gt;’
   return ListenSocket;
          ^~~~~~~~~~~~

Full diff: https://github.com/llvm/llvm-project/pull/75418.diff

1 Files Affected:

  • (modified) llvm/lib/Support/raw_ostream.cpp (+1-2)
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index d7a1f91a27defc..8c59ee21782735 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -1036,8 +1036,7 @@ Expected<ListeningSocket> ListeningSocket::createUnix(StringRef SocketPath,
 #else
   UnixSocket = MaybeWinsocket;
 #endif // _WIN32
-  ListeningSocket ListenSocket(UnixSocket, SocketPath);
-  return ListenSocket;
+  return ListeningSocket{UnixSocket, SocketPath};
 }
 
 Expected<std::unique_ptr<raw_socket_stream>> ListeningSocket::accept() {

Copy link
Contributor

@Bigcheese Bigcheese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@shiltian shiltian merged commit c76c00f into llvm:main Dec 14, 2023
@shiltian shiltian deleted the fix-gcc-7-5-build branch December 14, 2023 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants