Skip to content

[compilation error] Redundant move in ThreadingUtils #3668

@theli-ua

Description

@theli-ua

Describe the bug

FAILED: src/aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/ub_core.cpp.o 
/home/romanton/workspace/test_7642907480/env/CFlags-1.0/runtime/bin/x86_64-pc-linux-gnu-g++ -DAWS_ENABLE_EPOLL -DAWS_HAS_ALIGNED_ALLOC -DAWS_SDK_VERSION_MAJOR=1 -DAWS_SDK_VERSION_MINOR=11 -DAWS_SDK_VERSION_PATCH=712 -DAWS_TEST_REGION=US_EAST_1 -DAWS_USER_AGENT_CUSTOMIZATION=md/internal -DDISABLE_IMDSV1 -DENABLED_REQUEST_COMPRESSION -DENABLED_ZLIB_REQUEST_COMPRESSION -DENABLE_CURL_CLIENT -DENABLE_CURL_LOGGING -DENFORCE_TLS_V1_2 -DHAS_PATHCONF -DHAS_UMASK -DPLATFORM_LINUX -Iaws-sdk-cpp/src/aws-cpp-sdk-core/include/aws/core/platform/refs -Iaws-sdk-cpp/src/aws-cpp-sdk-core/include -I/home/romanton/brazil-pkg-cache/packages/CurlLive/CurlLive-1.0.496963.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-crt-cpp/Aws-crt-cpp-1.0.x.63712.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-c-http/Aws-c-http-1.0.x.565921.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-c-io/Aws-c-io-1.0.x.569247.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/S2N/S2N-0.x.683928.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-c-common/Aws-c-common-0.2.x.326876.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-c-cal/Aws-c-cal-1.0.x.354870.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Openssl/Openssl-1.1.x.513536.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-c-compression/Aws-c-compression-1.0.x.254966.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-c-mqtt/Aws-c-mqtt-1.0.x.565644.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-c-auth/Aws-c-auth-1.0.x.569681.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-c-sdkutils/Aws-c-sdkutils-1.0.x.223479.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-checksums/Aws-checksums-0.1.x.257316.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-c-event-stream/Aws-c-event-stream-0.1.x.562138.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Aws-c-s3/Aws-c-s3-1.0.x.549705.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -isystem /home/romanton/brazil-pkg-cache/packages/Zlib/Zlib-1.521052.0/AL2_x86_64/DEV.STD.PTHREAD/build/include -Wchar-subscripts -Wcomment -Wformat -Winit-self -Wmain -Wmissing-braces -Wno-pragmas -Wparentheses -Wreturn-type -Wsequence-point -Wstrict-aliasing -Wswitch -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused-label -Wunused-variable -Wunused-value -Wno-error=missing-include-dirs -Wno-error=narrowing -pthread -fdiagnostics-color=auto -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -march=x86-64-v3 -mtune=generic -g -fPIC -fno-operator-names -O2 -g -DNDEBUG -fno-exceptions -std=c++11 -fPIC -Wall -pedantic -Wextra -Werror -MD -MT src/aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/ub_core.cpp.o -MF src/aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/ub_core.cpp.o.d -o src/aws-cpp-sdk-core/CMakeFiles/aws-cpp-sdk-core.dir/ub_core.cpp.o -c src/aws-cpp-sdk-core/ub_core.cpp
In file included from aws-sdk-cpp/src/aws-cpp-sdk-core/include/aws/core/client/AWSProtocolClient.h:10,
                 from aws-sdk-cpp/src/aws-cpp-sdk-core/include/aws/core/client/AWSJsonClient.h:11,
                 from aws-sdk-cpp/src/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h:374,
                 from aws-sdk-cpp/src/aws-cpp-sdk-core/source/client/AWSUrlPresigner.cpp:7,
                 from src/aws-cpp-sdk-core/ub_core.cpp:21:
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h: In instantiation of ‘static T smithy::components::tracing::TracingUtils::MakeCallWithTiming(std::function<T()>, const Aws::String&, const smithy::components::tracing::Meter&, Aws::Map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&&, const Aws::String&) [with T = Aws::Utils::Outcome<std::shared_ptr<Aws::Http::HttpRequest>, Aws::Client::AWSError<Aws::Client::CoreErrors> >; Aws::String = std::__cxx11::basic_string<char>; Aws::Map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > = std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > > >]’:
aws-sdk-cpp/src/aws-cpp-sdk-core/source/smithy/client/AwsSmithyClientBase.cpp:388:85:   required from here
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: error: redundant move in initialization [-Werror=redundant-move]
   78 |                     RecordExecutionDuration(before, after, std::move(metricName), meter, std::move(attributes), std::move(description));
      |                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: note: remove ‘std::move’ call
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: error: redundant move in initialization [-Werror=redundant-move]
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: note: remove ‘std::move’ call
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h: In instantiation of ‘static T smithy::components::tracing::TracingUtils::MakeCallWithTiming(std::function<T()>, const Aws::String&, const smithy::components::tracing::Meter&, Aws::Map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&&, const Aws::String&) [with T = std::shared_ptr<Aws::Http::HttpResponse>; Aws::String = std::__cxx11::basic_string<char>; Aws::Map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > = std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > > >]’:
aws-sdk-cpp/src/aws-cpp-sdk-core/source/smithy/client/AwsSmithyClientBase.cpp:437:88:   required from here
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: error: redundant move in initialization [-Werror=redundant-move]
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: note: remove ‘std::move’ call
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: error: redundant move in initialization [-Werror=redundant-move]
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: note: remove ‘std::move’ call
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h: In instantiation of ‘static T smithy::components::tracing::TracingUtils::MakeCallWithTiming(std::function<T()>, const Aws::String&, const smithy::components::tracing::Meter&, Aws::Map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&&, const Aws::String&) [with T = long int; Aws::String = std::__cxx11::basic_string<char>; Aws::Map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > = std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > > >]’:
aws-sdk-cpp/src/aws-cpp-sdk-core/source/smithy/client/AwsSmithyClientBase.cpp:569:66:   required from here
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: error: redundant move in initialization [-Werror=redundant-move]
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: note: remove ‘std::move’ call
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: error: redundant move in initialization [-Werror=redundant-move]
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: note: remove ‘std::move’ call
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h: In instantiation of ‘static T smithy::components::tracing::TracingUtils::MakeCallWithTiming(std::function<T()>, const Aws::String&, const smithy::components::tracing::Meter&, Aws::Map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&&, const Aws::String&) [with T = bool; Aws::String = std::__cxx11::basic_string<char>; Aws::Map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > = std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > > >]’:
aws-sdk-cpp/src/aws-cpp-sdk-core/source/client/AWSClient.cpp:583:64:   required from here
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: error: redundant move in initialization [-Werror=redundant-move]
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: note: remove ‘std::move’ call
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: error: redundant move in initialization [-Werror=redundant-move]
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: note: remove ‘std::move’ call
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h: In instantiation of ‘static T smithy::components::tracing::TracingUtils::MakeCallWithTiming(std::function<T()>, const Aws::String&, const smithy::components::tracing::Meter&, Aws::Map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&&, const Aws::String&) [with T = Aws::Utils::Outcome<Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>, Aws::Client::AWSError<Aws::Client::CoreErrors> >; Aws::String = std::__cxx11::basic_string<char>; Aws::Map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > = std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > > >]’:
aws-sdk-cpp/src/aws-cpp-sdk-core/source/client/AWSXmlClient.cpp:109:89:   required from here
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: error: redundant move in initialization [-Werror=redundant-move]
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: note: remove ‘std::move’ call
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: error: redundant move in initialization [-Werror=redundant-move]
aws-sdk-cpp/src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h:78:44: note: remove ‘std::move’ call
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Expected to build

Current Behavior

Compiler error

Reproduction Steps

build with gcc-14, -Wredundant-move=error

Possible Solution

No response

Additional Information/Context

No response

AWS CPP SDK version used

1.11

Compiler and Version used

gcc 13

Operating System and version

AL2 x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions