[libcxx-commits] [libcxx] [libc++] Make std::pair trivially copyable if its members are (PR #89652)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 24 01:12:19 PDT 2024


gulfemsavrun wrote:

> @gulfemsavrun What even is the failure mode? I've never seen that error.

I know that the patch got reverted, but this is full error message that we get:
```
[36714/325859](63) CXX host_x64/obj/src/testing/catapult_converter/converter.converter.cc.o
FAILED: host_x64/obj/src/testing/catapult_converter/converter.converter.cc.o 
../../prebuilt/third_party/clang/custom/bin/clang++ -MD -MF host_x64/obj/src/testing/catapult_converter/converter.converter.cc.o.d -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -DNDEBUG=1 -DRAPIDJSON_HAS_STDSTRING -DRAPIDJSON_HAS_CXX11_RANGE_FOR -DRAPIDJSON_HAS_CXX11_RVALUE_REFS -DRAPIDJSON_HAS_CXX11_TYPETRAITS -DRAPIDJSON_HAS_CXX11_NOEXCEPT -I../.. -Ihost_x64/gen -I../../sdk -Ihost_x64/gen/sdk -I../../sdk/lib/fit-promise/include -I../../sdk/lib/fit/include -I../../sdk/lib/stdcompat/include -I../../zircon/system/public -I../../zircon/system/ulib/fbl/include -I../../third_party/rapidjson/include -fcolor-diagnostics -fcrash-diagnostics-dir=clang-crashreports -fcrash-diagnostics=all -gen-reproducer=error -ffp-contract=off --sysroot=../../prebuilt/third_party/sysroot/linux --target=x86_64-unknown-linux-gnu -ffile-compilation-dir=. -no-canonical-prefixes -fomit-frame-pointer -fdata-sections -ffunction-sections -Os -Xclang -debug-info-kind=constructor -g3 -grecord-gcc-switches -gdwarf-5 -gz=zstd -Wall -Wextra -Wconversion -Wextra-semi -Wimplicit-fallthrough -Wnewline-eof -Wstrict-prototypes -Wwrite-strings -Wno-sign-conversion -Wno-unused-parameter -Wnonportable-system-include-path -Wno-missing-field-initializers -Wno-extra-qualification -Wno-cast-function-type-strict -Wno-cast-function-type-mismatch -Wno-unknown-warning-option -Wno-missing-template-arg-list-after-template-kw -Wno-deprecated-pragma -fvisibility=hidden -Werror -Wa,--fatal-warnings --sysroot=../../prebuilt/third_party/sysroot/linux --target=x86_64-unknown-linux-gnu -fPIE -Wno-ambiguous-reversed-operator -Wno-option-ignored -fPIC -fvisibility-inlines-hidden -stdlib=libc++ -std=c++17 -fno-exceptions -fno-rtti -ftemplate-backtrace-limit=0 -stdlib=libc++ -c ../../src/testing/catapult_converter/converter.cc -o host_x64/obj/src/testing/catapult_converter/converter.converter.cc.o
In file included from ../../src/testing/catapult_converter/converter.cc:5:
In file included from ../../src/testing/catapult_converter/converter.h:8:
In file included from ../../third_party/rapidjson/include/rapidjson/document.h:20:
In file included from ../../third_party/rapidjson/include/rapidjson/reader.h:20:
In file included from ../../third_party/rapidjson/include/rapidjson/allocators.h:18:
In file included from ../../third_party/rapidjson/include/rapidjson/rapidjson.h:162:
In file included from ../../prebuilt/third_party/clang/custom/bin/../include/c++/v1/string:597:
In file included from ../../prebuilt/third_party/clang/custom/bin/../include/c++/v1/__functional/hash.h:20:
../../prebuilt/third_party/clang/custom/bin/../include/c++/v1/__utility/pair.h:102:31: error: the parameter for this explicitly-defaulted copy assignment operator is const, but a member or base requires it to be non-const
  102 |   _LIBCPP_HIDE_FROM_ABI pair& operator=(const pair&)
      |                               ^
../../prebuilt/third_party/clang/custom/bin/../include/c++/v1/map:766:14: note: in instantiation of template class 'std::pair<const std::string, rapidjson::GenericValue<rapidjson::UTF8<>>>' requested here
  766 |   value_type __cc_;
      |              ^
../../src/testing/catapult_converter/converter.cc:345:12: note: in instantiation of template class 'std::__value_type<std::string, rapidjson::GenericValue<rapidjson::UTF8<>>>' requested here
  345 |     if (it != test_suite_to_guid.end()) {
      |            ^
```
https://luci-milo.appspot.com/ui/p/fuchsia/builders/ci/clang_toolchain.ci.core.x64-release/b8741574608160376113/overview



https://github.com/llvm/llvm-project/pull/89652


More information about the libcxx-commits mailing list