Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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