Skip to content

Move llvm:Error types #69226

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
Oct 17, 2023
Merged

Conversation

etcwilde
Copy link
Member

Older compilers don't have the copy-elision rule of newer C++ compilers, resulting in an error message when returning a non-copyable type. Move llvm::Error instead of copying it.

/home/ewilde/work/swift-project/swift/lib/Frontend/CachingUtils.cpp:93:16: error: call to deleted constructor of 'llvm::Error'
        return Err;
               ^~~
/home/ewilde/work/swift-project/llvm-project/llvm/include/llvm/Support/Error.h:184:3: note: 'Error' has been explicitly marked deleted here
  Error(const Error &Other) = delete;
  ^
/home/ewilde/work/swift-project/llvm-project/llvm/include/llvm/Support/Error.h:491:18: note: passing argument to parameter 'Err' here
  Expected(Error Err)
                 ^
/home/ewilde/work/swift-project/swift/lib/Frontend/CachingUtils.cpp:123:16: error: call to deleted constructor of 'llvm::Error'
        return Err;
               ^~~
/home/ewilde/work/swift-project/llvm-project/llvm/include/llvm/Support/Error.h:184:3: note: 'Error' has been explicitly marked deleted here
  Error(const Error &Other) = delete;
  ^
/home/ewilde/work/swift-project/llvm-project/llvm/include/llvm/Support/Error.h:491:18: note: passing argument to parameter 'Err' here
  Expected(Error Err)
                 ^

Older compilers don't have the copy-elision of newer C++ compilers,
resulting in an error message when returning a non-copyable type. Move
llvm::Error instead of copying it.
@etcwilde
Copy link
Member Author

@swift-ci please smoke test

@cachemeifyoucan
Copy link
Contributor

LGTM.

@etcwilde etcwilde merged commit bffd78f into swiftlang:main Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants