Skip to content

Move non-copyable types #7676

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 27, 2023
Merged

Conversation

etcwilde
Copy link
Member

Older clang versions can't elide the copy, resulting in build failures when returning an llvm::Error that isn't explicitly moved.

FAILED: lib/MCCAS/CMakeFiles/LLVMMCCAS.dir/MCCASDebugV1.cpp.o 
/usr/bin/clang++ --target=x86_64-unknown-linux-gnu -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LIBCPP_ENABLE_HARDENED_MODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/ewilde/work/swift-project/build/Ninja-ReleaseAssert+stdlib-Release/llvm-linux-x86_64/lib/MCCAS -I/home/ewilde/work/swift-project/llvm-project/llvm/lib/MCCAS -I/home/ewilde/work/swift-project/build/Ninja-ReleaseAssert+stdlib-Release/llvm-linux-x86_64/include -I/home/ewilde/work/swift-project/llvm-project/llvm/include -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/MCCAS/CMakeFiles/LLVMMCCAS.dir/MCCASDebugV1.cpp.o -MF lib/MCCAS/CMakeFiles/LLVMMCCAS.dir/MCCASDebugV1.cpp.o.d -o lib/MCCAS/CMakeFiles/LLVMMCCAS.dir/MCCASDebugV1.cpp.o -c /home/ewilde/work/swift-project/llvm-project/llvm/lib/MCCAS/MCCASDebugV1.cpp
/home/ewilde/work/swift-project/llvm-project/llvm/lib/MCCAS/MCCASDebugV1.cpp:294:12: error: call to deleted constructor of 'llvm::Error'
    return E;
           ^
/home/ewilde/work/swift-project/llvm-project/llvm/include/llvm/Support/Error.h:183: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:490:18: note: passing argument to parameter 'Err' here
  Expected(Error Err)
                 ^
1 error generated.

@etcwilde
Copy link
Member Author

@swift-ci please test

Copy link

@rastogishubham rastogishubham left a comment

Choose a reason for hiding this comment

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

LGTM!

Older clang versions can't elide the copy, resulting in build failures
when returning an `llvm::Error` that isn't explicitly moved.
@etcwilde
Copy link
Member Author

@swift-ci please test

@etcwilde
Copy link
Member Author

@swift-ci please test Windows

@etcwilde etcwilde merged commit 5ef4c55 into swiftlang:stable/20230725 Oct 27, 2023
@etcwilde etcwilde deleted the ewilde/fix-move branch October 27, 2023 17:58
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