Skip to content

Commit 6aa60b0

Browse files
committed
[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.
1 parent 1dfb1a8 commit 6aa60b0

File tree

6 files changed

+4
-44
lines changed

6 files changed

+4
-44
lines changed

lldb/include/lldb/Core/SearchFilter.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,6 @@ class SearchFilterByModuleList : public SearchFilter {
366366

367367
~SearchFilterByModuleList() override;
368368

369-
SearchFilterByModuleList &operator=(const SearchFilterByModuleList &rhs);
370-
371369
bool ModulePasses(const lldb::ModuleSP &module_sp) override;
372370

373371
bool ModulePasses(const FileSpec &spec) override;
@@ -416,13 +414,8 @@ class SearchFilterByModuleListAndCU : public SearchFilterByModuleList {
416414
const FileSpecList &module_list,
417415
const FileSpecList &cu_list);
418416

419-
SearchFilterByModuleListAndCU(const SearchFilterByModuleListAndCU &rhs);
420-
421417
~SearchFilterByModuleListAndCU() override;
422418

423-
SearchFilterByModuleListAndCU &
424-
operator=(const SearchFilterByModuleListAndCU &rhs);
425-
426419
bool AddressPasses(Address &address) override;
427420

428421
bool CompUnitPasses(FileSpec &fileSpec) override;

lldb/include/lldb/Host/SocketAddress.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ class SocketAddress {
4848
~SocketAddress();
4949

5050
// Operators
51-
const SocketAddress &operator=(const SocketAddress &rhs);
52-
5351
const SocketAddress &operator=(const struct addrinfo *addr_info);
5452

5553
const SocketAddress &operator=(const struct sockaddr &s);

lldb/include/lldb/Utility/StringExtractorGDBRemote.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ class StringExtractorGDBRemote : public StringExtractor {
3131
StringExtractorGDBRemote(const char *cstr)
3232
: StringExtractor(cstr), m_validator(nullptr) {}
3333

34-
StringExtractorGDBRemote(const StringExtractorGDBRemote &rhs)
35-
: StringExtractor(rhs), m_validator(rhs.m_validator) {}
36-
37-
~StringExtractorGDBRemote() override {}
38-
3934
bool ValidateResponse() const;
4035

4136
void CopyResponseValidator(const StringExtractorGDBRemote &rhs);

lldb/source/Core/SearchFilter.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,6 @@ SearchFilterByModuleList::SearchFilterByModuleList(
523523
enum FilterTy filter_ty)
524524
: SearchFilter(target_sp, filter_ty), m_module_spec_list(module_list) {}
525525

526-
SearchFilterByModuleList &SearchFilterByModuleList::
527-
operator=(const SearchFilterByModuleList &rhs) {
528-
m_target_sp = rhs.m_target_sp;
529-
m_module_spec_list = rhs.m_module_spec_list;
530-
return *this;
531-
}
532-
533526
SearchFilterByModuleList::~SearchFilterByModuleList() = default;
534527

535528
bool SearchFilterByModuleList::ModulePasses(const ModuleSP &module_sp) {
@@ -669,19 +662,6 @@ SearchFilterByModuleListAndCU::SearchFilterByModuleListAndCU(
669662
FilterTy::ByModulesAndCU),
670663
m_cu_spec_list(cu_list) {}
671664

672-
SearchFilterByModuleListAndCU::SearchFilterByModuleListAndCU(
673-
const SearchFilterByModuleListAndCU &rhs) = default;
674-
675-
SearchFilterByModuleListAndCU &SearchFilterByModuleListAndCU::
676-
operator=(const SearchFilterByModuleListAndCU &rhs) {
677-
if (&rhs != this) {
678-
m_target_sp = rhs.m_target_sp;
679-
m_module_spec_list = rhs.m_module_spec_list;
680-
m_cu_spec_list = rhs.m_cu_spec_list;
681-
}
682-
return *this;
683-
}
684-
685665
SearchFilterByModuleListAndCU::~SearchFilterByModuleListAndCU() = default;
686666

687667
lldb::SearchFilterSP SearchFilterByModuleListAndCU::CreateFromStructuredData(

lldb/source/Host/common/SocketAddress.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,6 @@ bool SocketAddress::SetPort(uint16_t port) {
174174
}
175175

176176
// SocketAddress assignment operator
177-
const SocketAddress &SocketAddress::operator=(const SocketAddress &rhs) {
178-
if (this != &rhs)
179-
m_socket_addr = rhs.m_socket_addr;
180-
return *this;
181-
}
182-
183177
const SocketAddress &SocketAddress::
184178
operator=(const struct addrinfo *addr_info) {
185179
Clear();

lldb/source/Host/common/TCPSocket.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ Status TCPSocket::Connect(llvm::StringRef name) {
149149
if (!DecodeHostAndPort(name, host_str, port_str, port, &error))
150150
return error;
151151

152-
auto addresses = lldb_private::SocketAddress::GetAddressInfo(
152+
std::vector<SocketAddress> addresses = SocketAddress::GetAddressInfo(
153153
host_str.c_str(), nullptr, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
154-
for (auto address : addresses) {
154+
for (SocketAddress &address : addresses) {
155155
error = CreateSocket(address.GetFamily());
156156
if (error.Fail())
157157
continue;
@@ -187,9 +187,9 @@ Status TCPSocket::Listen(llvm::StringRef name, int backlog) {
187187

188188
if (host_str == "*")
189189
host_str = "0.0.0.0";
190-
auto addresses = lldb_private::SocketAddress::GetAddressInfo(
190+
std::vector<SocketAddress> addresses = SocketAddress::GetAddressInfo(
191191
host_str.c_str(), nullptr, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
192-
for (auto address : addresses) {
192+
for (SocketAddress &address : addresses) {
193193
int fd = Socket::CreateSocket(address.GetFamily(), kType, IPPROTO_TCP,
194194
m_child_processes_inherit, error);
195195
if (error.Fail()) {

0 commit comments

Comments
 (0)