GCC fix: Don’t name a method exactly the same as its return type

While compiling, for example,
minidump_simple_string_dictionary_writer.cc:

In file included from
../../minidump/minidump_module_crashpad_info_writer.cc:21:0:
../../minidump/minidump_simple_string_dictionary_writer.h:55:45: error:
declaration of ‘const crashpad::MinidumpSimpleStringDictionaryEntry*
crashpad::MinidumpSimpleStringDictionaryEntryWriter::MinidumpSimpleStringDictionaryEntry()
const’ [-fpermissive]
       MinidumpSimpleStringDictionaryEntry() const;
                                             ^~~~~
In file included from
../../minidump/minidump_module_crashpad_info_writer.h:25:0,
                 from
../../minidump/minidump_module_crashpad_info_writer.cc:15:
../../minidump/minidump_extensions.h:255:26: error: changes meaning of
‘MinidumpSimpleStringDictionaryEntry’ from ‘struct
crashpad::MinidumpSimpleStringDictionaryEntry’ [-fpermissive]
 struct ALIGNAS(4) PACKED MinidumpSimpleStringDictionaryEntry {
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tested with:
 - GCC 4.9 from NDK r13 targeting arm with SDK 16
 - GCC 4.9 from NDK r13 targeting arm64 with SDK 21
 - GCC 6.2 targeting x86_64

BUG=crashpad:30

Change-Id: I1e5e6a21a24f19eef7602e4123459ce15f3b089e
Reviewed-on: https://chromium-review.googlesource.com/409624
Reviewed-by: Robert Sesek <rsesek@chromium.org>
This commit is contained in:
Mark Mentovai 2016-11-10 13:23:05 -05:00
Родитель dd85381a32
Коммит 5b14b41992
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -34,8 +34,8 @@ MinidumpSimpleStringDictionaryEntryWriter::
}
const MinidumpSimpleStringDictionaryEntry*
MinidumpSimpleStringDictionaryEntryWriter::MinidumpSimpleStringDictionaryEntry()
const {
MinidumpSimpleStringDictionaryEntryWriter::
GetMinidumpSimpleStringDictionaryEntry() const {
DCHECK_EQ(state(), kStateWritable);
return &entry_;
@ -179,7 +179,7 @@ bool MinidumpSimpleStringDictionaryWriter::WriteObject(
std::vector<WritableIoVec> iovecs(1, iov);
for (const auto& key_entry : entries_) {
iov.iov_base = key_entry.second->MinidumpSimpleStringDictionaryEntry();
iov.iov_base = key_entry.second->GetMinidumpSimpleStringDictionaryEntry();
iov.iov_len = sizeof(MinidumpSimpleStringDictionaryEntry);
iovecs.push_back(iov);
}

Просмотреть файл

@ -52,7 +52,7 @@ class MinidumpSimpleStringDictionaryEntryWriter final
//!
//! \note Valid in #kStateWritable.
const MinidumpSimpleStringDictionaryEntry*
MinidumpSimpleStringDictionaryEntry() const;
GetMinidumpSimpleStringDictionaryEntry() const;
//! \brief Sets the strings to be written as the entry objects key and value.
//!