• Jan Wilken Dörrie's avatar
    Revert "flat_map: Readd constructors and assignment operator overloads." · 7053a3a2
    Jan Wilken Dörrie authored
    This reverts commit 1131840b.
    
    Reason for revert: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89381
    got fixed and this change interferes with https://crrev.com/c/2494941.
    That change added a new sorted_unique_t constructor tag to
    base::flat_tree, but wasn't taking effect for flat_map, since those
    constructors were not inherited.
    
    
    Original change's description:
    > flat_map: Readd constructors and assignment operator overloads.
    >
    > https://chromium-review.googlesource.com/c/chromium/src/+/705955 ("base::flat_map
    > was missing defaults for duplication handling") removed them in favor of
    > inheriting them from flat_tree.
    >
    > This can cause problems with GCC due to
    > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84782, and the build has been
    > failing with it since
    > https://chromium-review.googlesource.com/1000393 ("Mojo C++ Bindings:
    > unordered_map => flat_map") with a message like this:
    >
    >     gen/mojo/public/interfaces/bindings/tests/test_unions.mojom.cc: In member function ‘void mojo::test::ObjectUnion::set_f_map_int8(const base::flat_map<std::__cxx11::basic_string<char>, signed char>&)’:
    >     gen/mojo/public/interfaces/bindings/tests/test_unions.mojom.cc:455:30: error: use of deleted function ‘base::flat_map<std::__cxx11::basic_string<char>, signed char>::flat_map(const base::flat_map<std::__cxx11::basic_string<char>, signed char>&)’
    >              std::move(f_map_int8));
    >                                   ^
    >     In file included from ../../mojo/public/cpp/bindings/clone_traits.h:11:0,
    >                      from gen/mojo/public/interfaces/bindings/tests/test_unions.mojom.h:22,
    >                      from gen/mojo/public/interfaces/bindings/tests/test_unions.mojom.cc:15:
    >     ../../base/containers/flat_map.h:152:7: note: ‘base::flat_map<std::__cxx11::basic_string<char>, signed char>::flat_map(const base::flat_map<std::__cxx11::basic_string<char>, signed char>&)’ is implicitly declared as deleted because ‘base::flat_map<std::__cxx11::basic_string<char>, signed char>’ declares a move constructor or move assignment operator
    >      class flat_map : public ::base::internal::flat_tree<
    >            ^~~~~~~~
    >
    > Work around it by replacing the inheritance statements with actual
    > constructors and operator=() overloads again. This change does not
    > completely revert https://chromium-review.googlesource.com/1000393, as the
    > constructors maintain their new signature (so that they look like
    > flat_tree's).
    >
    > Bug: 819294, 837221
    > Change-Id: I8f37a2c8aa269b3c1025cdc009518a7709e95947
    > Reviewed-on: https://chromium-review.googlesource.com/1038103
    > Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
    > Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    > Reviewed-by: kylechar <kylechar@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#556168}
    
    TBR=danakj@chromium.org,dcheng@chromium.org,raphael.kubo.da.costa@intel.com,kylechar@chromium.org
    
    # Not skipping CQ checks because original CL landed > 1 day ago.
    
    Bug: 819294
    Bug: 837221
    Change-Id: I72915a49981c114f16eaa866de226e9cd242a348
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526100Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#825738}
    7053a3a2
test_utils.cc 16.9 KB