Brad Bishop | c8f4712 | 2019-06-24 09:36:18 -0400 | [diff] [blame] | 1 | From ea6e776e50971c89ad2293046b6ae2a6a9753c56 Mon Sep 17 00:00:00 2001 |
| 2 | From: Adam Cozzette <acozzette@google.com> |
| 3 | Date: Thu, 6 Jun 2019 10:29:58 -0700 |
| 4 | Subject: [PATCH] Added stubs/map_util.h to list of installed headers |
| 5 | |
| 6 | This should fix issue #6186. I also had to remove a couple unnecessary |
| 7 | const keywords in map_util.h because the no_warning_test was showing |
| 8 | errors about those. |
| 9 | |
| 10 | Upstream-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 | |
| 16 | diff --git a/src/Makefile.am b/src/Makefile.am |
| 17 | index 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 \ |
| 28 | diff --git a/src/google/protobuf/stubs/map_util.h b/src/google/protobuf/stubs/map_util.h |
| 29 | index 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 | -- |
| 51 | 2.11.0 |
| 52 | |