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

Fix warnings C26800: Use of a moved from object, in certificate_client_models.hpp #6227

Open
ahsonkhan opened this issue Nov 15, 2024 · 0 comments
Labels
KeyVault MQ This issue is part of a "milestone of quality" initiative.

Comments

@ahsonkhan
Copy link
Member

https://learn.microsoft.com/en-us/cpp/code-quality/c26800?view=msvc-170

Severity	Code	Description	Project	File	Line	Suppression State	Details
Warning	C26800	Use of a moved from object: ''(certificateProperties->Azure::Security::KeyVault::Certificates::CertificatePropertiesPagedResponse::Items)'' (lifetime.1).	azure-sdk	C:\GitHub\Fork\azure-sdk-for-cpp\sdk\keyvault\azure-security-keyvault-certificates\inc\azure\keyvault\certificates\certificate_client_models.hpp	1330		
Warning	C26800	Use of a moved from object: ''(issuerProperties->Azure::Security::KeyVault::Certificates::IssuerPropertiesPagedResponse::Items)'' (lifetime.1).	azure-sdk	C:\GitHub\Fork\azure-sdk-for-cpp\sdk\keyvault\azure-security-keyvault-certificates\inc\azure\keyvault\certificates\certificate_client_models.hpp	1368		
Warning	C26800	Use of a moved from object: ''(deletedProperties->Azure::Security::KeyVault::Certificates::DeletedCertificatesPagedResponse::Items)'' (lifetime.1).	azure-sdk	C:\GitHub\Fork\azure-sdk-for-cpp\sdk\keyvault\azure-security-keyvault-certificates\inc\azure\keyvault\certificates\certificate_client_models.hpp	1406		

For example, note that Items(std::move(certificateProperties.Items)) is giving a warning because certificateProperties has already moved, in PagedResponse(std::move(certificateProperties)).

CertificatePropertiesPagedResponse(
CertificatePropertiesPagedResponse&& certificateProperties,
std::unique_ptr<Azure::Core::Http::RawResponse> rawResponse,
std::shared_ptr<CertificateClient> certificateClient,
std::string const& certificateName = std::string())
: PagedResponse(std::move(certificateProperties)), m_certificateName(certificateName),
m_certificateClient(certificateClient), Items(std::move(certificateProperties.Items))
{

IssuerPropertiesPagedResponse(
IssuerPropertiesPagedResponse&& issuerProperties,
std::unique_ptr<Azure::Core::Http::RawResponse> rawResponse,
std::shared_ptr<CertificateClient> certificateClient)
: PagedResponse(std::move(issuerProperties)), m_certificateClient(certificateClient),
Items(std::move(issuerProperties.Items))
{

DeletedCertificatesPagedResponse(
DeletedCertificatesPagedResponse&& deletedProperties,
std::unique_ptr<Azure::Core::Http::RawResponse> rawResponse,
std::shared_ptr<CertificateClient> certificateClient)
: PagedResponse(std::move(deletedProperties)), m_certificateClient(certificateClient),
Items(std::move(deletedProperties.Items))
{

@ahsonkhan ahsonkhan added KeyVault MQ This issue is part of a "milestone of quality" initiative. labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
KeyVault MQ This issue is part of a "milestone of quality" initiative.
Projects
Status: Untriaged
Development

No branches or pull requests

1 participant