blob: a160e5e9787019bf1d57349a18d608dede383077 [file] [log] [blame]
Brad Bishopc8f47122019-06-24 09:36:18 -04001From ea6e776e50971c89ad2293046b6ae2a6a9753c56 Mon Sep 17 00:00:00 2001
2From: Adam Cozzette <acozzette@google.com>
3Date: Thu, 6 Jun 2019 10:29:58 -0700
4Subject: [PATCH] Added stubs/map_util.h to list of installed headers
5
6This should fix issue #6186. I also had to remove a couple unnecessary
7const keywords in map_util.h because the no_warning_test was showing
8errors about those.
9
10Upstream-Status: Submitted [https://github.com/protocolbuffers/protobuf/pull/6223]
11---
12 src/Makefile.am | 1 +
13 src/google/protobuf/stubs/map_util.h | 4 ++--
14 2 files changed, 3 insertions(+), 2 deletions(-)
15
16diff --git a/src/Makefile.am b/src/Makefile.am
17index be18ba76..1689e221 100644
18--- a/src/Makefile.am
19+++ b/src/Makefile.am
20@@ -72,6 +72,7 @@ nobase_include_HEADERS = \
21 google/protobuf/stubs/hash.h \
22 google/protobuf/stubs/logging.h \
23 google/protobuf/stubs/macros.h \
24+ google/protobuf/stubs/map_util.h \
25 google/protobuf/stubs/mutex.h \
26 google/protobuf/stubs/once.h \
27 google/protobuf/stubs/platform_macros.h \
28diff --git a/src/google/protobuf/stubs/map_util.h b/src/google/protobuf/stubs/map_util.h
29index 2313e1f5..b04d9d46 100644
30--- a/src/google/protobuf/stubs/map_util.h
31+++ b/src/google/protobuf/stubs/map_util.h
32@@ -620,7 +620,7 @@ bool UpdateReturnCopy(Collection* const collection,
33 // twice. Unlike UpdateReturnCopy this also does not come with the issue of an
34 // undefined previous* in case new data was inserted.
35 template <class Collection>
36-typename Collection::value_type::second_type* const
37+typename Collection::value_type::second_type*
38 InsertOrReturnExisting(Collection* const collection,
39 const typename Collection::value_type& vt) {
40 std::pair<typename Collection::iterator, bool> ret = collection->insert(vt);
41@@ -633,7 +633,7 @@ InsertOrReturnExisting(Collection* const collection,
42
43 // Same as above, except for explicit key and data.
44 template <class Collection>
45-typename Collection::value_type::second_type* const
46+typename Collection::value_type::second_type*
47 InsertOrReturnExisting(
48 Collection* const collection,
49 const typename Collection::value_type::first_type& key,
50--
512.11.0
52