Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete operator=(Self&) when copy constructor is deleted #8535

Merged
merged 1 commit into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libraries/ESP8266WiFi/src/BearSSLHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class PublicKey {

// Disable the copy constructor, we're pointer based
PublicKey(const PublicKey& that) = delete;
PublicKey& operator=(const PublicKey& that) = delete;

private:
brssl::public_key *_key;
Expand Down Expand Up @@ -86,6 +87,7 @@ class PrivateKey {

// Disable the copy constructor, we're pointer based
PrivateKey(const PrivateKey& that) = delete;
PrivateKey& operator=(const PrivateKey& that) = delete;

private:
brssl::private_key *_key;
Expand Down Expand Up @@ -122,6 +124,7 @@ class X509List {

// Disable the copy constructor, we're pointer based
X509List(const X509List& that) = delete;
X509List& operator=(const X509List& that) = delete;

private:
size_t _count;
Expand Down
4 changes: 2 additions & 2 deletions libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace BearSSL {
class WiFiClientSecureCtx : public WiFiClient {
public:
WiFiClientSecureCtx();
WiFiClientSecureCtx(const WiFiClientSecure &rhs) = delete;
WiFiClientSecureCtx(const WiFiClientSecureCtx &rhs) = delete;
~WiFiClientSecureCtx() override;

WiFiClientSecureCtx& operator=(const WiFiClientSecureCtx&) = delete;
Expand All @@ -43,7 +43,7 @@ class WiFiClientSecureCtx : public WiFiClient {
// TODO: don't remove just yet to avoid including the WiFiClient default implementation and unintentionally causing
// a 'slice' that this method tries to avoid in the first place
std::unique_ptr<WiFiClient> clone() const override {
return std::unique_ptr<WiFiClient>(new WiFiClientSecureCtx(*this));
return nullptr;
}

int connect(IPAddress ip, uint16_t port) override;
Expand Down