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

Some classes delete the copy constructor, as it's unsound, but allow operator=(Self&) #8534

Closed
5 of 6 tasks
paulocsanz opened this issue Apr 9, 2022 · 0 comments · Fixed by #8535
Closed
5 of 6 tasks

Comments

@paulocsanz
Copy link
Contributor

paulocsanz commented Apr 9, 2022

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Core Version: 684156d
  • Development Env: Platformio
  • Operating System: Windows-WSL2

Problem Description

Seeing this issue/comment #8522 inspired me to check for other places where we were forgetting to delete some constructor/assignment. And it turned out I found a few places with problems that would lead to invalid logic.

MCVE Sketch

This should compile, but it doesn't

#include <WiFiClientSecureBearSSL.h>

void setup() {
  static_assert(!std::is_copy_constructible<BearSSL::WiFiClientSecureCtx>());
  static_assert(!std::is_copy_assignable<BearSSL::WiFiClientSecureCtx>());
  static_assert(!std::is_copy_constructible<BearSSL::PublicKey>());
  static_assert(!std::is_copy_assignable<BearSSL::PublicKey>());
  static_assert(!std::is_copy_constructible<BearSSL::PrivateKey>());
  static_assert(!std::is_copy_assignable<BearSSL::PrivateKey>());
  static_assert(!std::is_copy_constructible<BearSSL::X509List>());
  static_assert(!std::is_copy_assignable<BearSSL::X509List>());
}
void loop() {}
@paulocsanz paulocsanz changed the title BearSSL::WiFiClientSecureCtx actually is copy constructible Some classes delete the copy constructor, as it's unsound, but allow operator=(Self&) Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant