Skip to content

induce errors#9

Open
stsoe wants to merge 14 commits intomainfrom
ctidy
Open

induce errors#9
stsoe wants to merge 14 commits intomainfrom
ctidy

Conversation

@stsoe
Copy link
Owner

@stsoe stsoe commented Feb 28, 2025

No description provided.

Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

const std::string hello()
{
std::string str = "hello";
X x(str);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable name 'x' is too short, expected at least 3 characters [readability-identifier-length]

  X x(str);
    ^

stsoe and others added 10 commits February 28, 2025 10:10
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

{
std::string m_string;
public:
X(const std::string& str) : m_string(str) {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: pass by value and use std::move [modernize-pass-by-value]

src/hello.cpp:2:

+ #include <utility>
Suggested change
X(const std::string& str) : m_string(str) {}
X(std::string str) : m_string(std::move(str)) {}

{
std::string m_string;
public:
X(const std::string& str) : m_string(str) {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: single-argument constructors must be marked explicit to avoid unintentional implicit conversions [hicpp-explicit-conversions]

Suggested change
X(const std::string& str) : m_string(str) {}
explicit X(const std::string& str) : m_string(str) {}

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 this pull request may close these issues.

1 participant