Skip to content

build error: moving a temporary object prevents copy elision [-Wpessimizing-move]  #487

Description

@yew1eb

Bug description

[393/1774] Building CXX object velox/dwio/common/CMakeFiles/velox_dwio_common.dir/TypeWithId.cpp.o
FAILED: velox/dwio/common/CMakeFiles/velox_dwio_common.dir/TypeWithId.cpp.o 
/opt/homebrew/bin/ccache /Library/Developer/CommandLineTools/usr/bin/c++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DFOLLY_HAVE_INT128_T=1 -DGFLAGS_IS_A_DLL=0 -I/Users/yew1eb/workspaces/oap-velox/. -I/Users/yew1eb/workspaces/oap-velox/velox/external/xxhash -isystem /usr/local/include -isystem /Users/yew1eb/workspaces/oap-velox/velox -isystem /Users/yew1eb/workspaces/oap-velox/velox/external -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/openssl@3/3.2.1/include -mcpu=apple-m1+crc -std=c++17 -fvisibility=hidden -D USE_VELOX_COMMON_BASE -D HAS_UNCAUGHT_EXCEPTIONS -Wall -Wextra -Wno-unused        -Wno-unused-parameter        -Wno-sign-compare        -Wno-ignored-qualifiers        -Wno-range-loop-analysis          -Wno-mismatched-tags          -Wno-nullability-completeness -Werror -O3 -DNDEBUG -std=gnu++17 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -mmacosx-version-min=14.3 -fPIC -fcolor-diagnostics -MD -MT velox/dwio/common/CMakeFiles/velox_dwio_common.dir/TypeWithId.cpp.o -MF velox/dwio/common/CMakeFiles/velox_dwio_common.dir/TypeWithId.cpp.o.d -o velox/dwio/common/CMakeFiles/velox_dwio_common.dir/TypeWithId.cpp.o -c /Users/yew1eb/workspaces/oap-velox/velox/dwio/common/TypeWithId.cpp
/Users/yew1eb/workspaces/oap-velox/velox/dwio/common/TypeWithId.cpp:89:27: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
    children.emplace_back(std::move(child->duplicate(nameAsLowerCase)));
                          ^
/Users/yew1eb/workspaces/oap-velox/velox/dwio/common/TypeWithId.cpp:89:27: note: remove std::move call here
    children.emplace_back(std::move(child->duplicate(nameAsLowerCase)));
                          ^~~~~~~~~~                                 ~
1 error generated.

System information

ProductName: macOS
ProductVersion: 14.3.1
BuildVersion: 23D60

-- Building using CMake version: 3.29.2
-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309

Relevant logs

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions