[Lldb-commits] [lldb] 6aa60b0 - [lldb] Fix more -Wdeprecated-copy warnings
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 12 05:58:00 PST 2019
Author: Pavel Labath
Date: 2019-11-12T14:39:47+01:00
New Revision: 6aa60b0514865751ea9dd208236db60eb69aaf1e
URL: https://github.com/llvm/llvm-project/commit/6aa60b0514865751ea9dd208236db60eb69aaf1e
DIFF: https://github.com/llvm/llvm-project/commit/6aa60b0514865751ea9dd208236db60eb69aaf1e.diff
LOG: [lldb] Fix more -Wdeprecated-copy warnings
This warning triggers when a class defines a copy constructor but not a
copy-assignment operator (which then gets auto-generated by the
compiler). Fix the warning by deleting the other operator too, as the
default implementation works just fine.
Added:
Modified:
lldb/include/lldb/Core/SearchFilter.h
lldb/include/lldb/Host/SocketAddress.h
lldb/include/lldb/Utility/StringExtractorGDBRemote.h
lldb/source/Core/SearchFilter.cpp
lldb/source/Host/common/SocketAddress.cpp
lldb/source/Host/common/TCPSocket.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Core/SearchFilter.h b/lldb/include/lldb/Core/SearchFilter.h
index 6823daf9e3ed..97880f693887 100644
--- a/lldb/include/lldb/Core/SearchFilter.h
+++ b/lldb/include/lldb/Core/SearchFilter.h
@@ -366,8 +366,6 @@ class SearchFilterByModuleList : public SearchFilter {
~SearchFilterByModuleList() override;
- SearchFilterByModuleList &operator=(const SearchFilterByModuleList &rhs);
-
bool ModulePasses(const lldb::ModuleSP &module_sp) override;
bool ModulePasses(const FileSpec &spec) override;
@@ -416,13 +414,8 @@ class SearchFilterByModuleListAndCU : public SearchFilterByModuleList {
const FileSpecList &module_list,
const FileSpecList &cu_list);
- SearchFilterByModuleListAndCU(const SearchFilterByModuleListAndCU &rhs);
-
~SearchFilterByModuleListAndCU() override;
- SearchFilterByModuleListAndCU &
- operator=(const SearchFilterByModuleListAndCU &rhs);
-
bool AddressPasses(Address &address) override;
bool CompUnitPasses(FileSpec &fileSpec) override;
diff --git a/lldb/include/lldb/Host/SocketAddress.h b/lldb/include/lldb/Host/SocketAddress.h
index 620827ff6eb1..766303a3c1fd 100644
--- a/lldb/include/lldb/Host/SocketAddress.h
+++ b/lldb/include/lldb/Host/SocketAddress.h
@@ -48,8 +48,6 @@ class SocketAddress {
~SocketAddress();
// Operators
- const SocketAddress &operator=(const SocketAddress &rhs);
-
const SocketAddress &operator=(const struct addrinfo *addr_info);
const SocketAddress &operator=(const struct sockaddr &s);
diff --git a/lldb/include/lldb/Utility/StringExtractorGDBRemote.h b/lldb/include/lldb/Utility/StringExtractorGDBRemote.h
index cbf6e0c29e8e..715f3cb2541d 100644
--- a/lldb/include/lldb/Utility/StringExtractorGDBRemote.h
+++ b/lldb/include/lldb/Utility/StringExtractorGDBRemote.h
@@ -31,11 +31,6 @@ class StringExtractorGDBRemote : public StringExtractor {
StringExtractorGDBRemote(const char *cstr)
: StringExtractor(cstr), m_validator(nullptr) {}
- StringExtractorGDBRemote(const StringExtractorGDBRemote &rhs)
- : StringExtractor(rhs), m_validator(rhs.m_validator) {}
-
- ~StringExtractorGDBRemote() override {}
-
bool ValidateResponse() const;
void CopyResponseValidator(const StringExtractorGDBRemote &rhs);
diff --git a/lldb/source/Core/SearchFilter.cpp b/lldb/source/Core/SearchFilter.cpp
index e02b4f66b58c..8f80caa3eb4d 100644
--- a/lldb/source/Core/SearchFilter.cpp
+++ b/lldb/source/Core/SearchFilter.cpp
@@ -523,13 +523,6 @@ SearchFilterByModuleList::SearchFilterByModuleList(
enum FilterTy filter_ty)
: SearchFilter(target_sp, filter_ty), m_module_spec_list(module_list) {}
-SearchFilterByModuleList &SearchFilterByModuleList::
-operator=(const SearchFilterByModuleList &rhs) {
- m_target_sp = rhs.m_target_sp;
- m_module_spec_list = rhs.m_module_spec_list;
- return *this;
-}
-
SearchFilterByModuleList::~SearchFilterByModuleList() = default;
bool SearchFilterByModuleList::ModulePasses(const ModuleSP &module_sp) {
@@ -669,19 +662,6 @@ SearchFilterByModuleListAndCU::SearchFilterByModuleListAndCU(
FilterTy::ByModulesAndCU),
m_cu_spec_list(cu_list) {}
-SearchFilterByModuleListAndCU::SearchFilterByModuleListAndCU(
- const SearchFilterByModuleListAndCU &rhs) = default;
-
-SearchFilterByModuleListAndCU &SearchFilterByModuleListAndCU::
-operator=(const SearchFilterByModuleListAndCU &rhs) {
- if (&rhs != this) {
- m_target_sp = rhs.m_target_sp;
- m_module_spec_list = rhs.m_module_spec_list;
- m_cu_spec_list = rhs.m_cu_spec_list;
- }
- return *this;
-}
-
SearchFilterByModuleListAndCU::~SearchFilterByModuleListAndCU() = default;
lldb::SearchFilterSP SearchFilterByModuleListAndCU::CreateFromStructuredData(
diff --git a/lldb/source/Host/common/SocketAddress.cpp b/lldb/source/Host/common/SocketAddress.cpp
index 882fd24558f7..960ed18dc768 100644
--- a/lldb/source/Host/common/SocketAddress.cpp
+++ b/lldb/source/Host/common/SocketAddress.cpp
@@ -174,12 +174,6 @@ bool SocketAddress::SetPort(uint16_t port) {
}
// SocketAddress assignment operator
-const SocketAddress &SocketAddress::operator=(const SocketAddress &rhs) {
- if (this != &rhs)
- m_socket_addr = rhs.m_socket_addr;
- return *this;
-}
-
const SocketAddress &SocketAddress::
operator=(const struct addrinfo *addr_info) {
Clear();
diff --git a/lldb/source/Host/common/TCPSocket.cpp b/lldb/source/Host/common/TCPSocket.cpp
index e84054f3f581..8be0b2e2fc02 100644
--- a/lldb/source/Host/common/TCPSocket.cpp
+++ b/lldb/source/Host/common/TCPSocket.cpp
@@ -149,9 +149,9 @@ Status TCPSocket::Connect(llvm::StringRef name) {
if (!DecodeHostAndPort(name, host_str, port_str, port, &error))
return error;
- auto addresses = lldb_private::SocketAddress::GetAddressInfo(
+ std::vector<SocketAddress> addresses = SocketAddress::GetAddressInfo(
host_str.c_str(), nullptr, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
- for (auto address : addresses) {
+ for (SocketAddress &address : addresses) {
error = CreateSocket(address.GetFamily());
if (error.Fail())
continue;
@@ -187,9 +187,9 @@ Status TCPSocket::Listen(llvm::StringRef name, int backlog) {
if (host_str == "*")
host_str = "0.0.0.0";
- auto addresses = lldb_private::SocketAddress::GetAddressInfo(
+ std::vector<SocketAddress> addresses = SocketAddress::GetAddressInfo(
host_str.c_str(), nullptr, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
- for (auto address : addresses) {
+ for (SocketAddress &address : addresses) {
int fd = Socket::CreateSocket(address.GetFamily(), kType, IPPROTO_TCP,
m_child_processes_inherit, error);
if (error.Fail()) {
More information about the lldb-commits
mailing list