Skip to content

induce errors#9

Open
stsoe wants to merge 14 commits into
mainfrom
ctidy
Open

induce errors#9
stsoe wants to merge 14 commits into
mainfrom
ctidy

Conversation

@stsoe
Copy link
Copy Markdown
Owner

@stsoe stsoe commented Feb 28, 2025

No description provided.

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

@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

Comment thread src/hello.cpp Outdated
Comment thread src/hello.cpp Outdated
Comment thread src/hello.cpp Outdated
Comment thread src/hello.cpp
const std::string hello()
{
std::string str = "hello";
X x(str);
Copy link
Copy Markdown

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);
    ^

Comment thread src/hello.cpp Outdated
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
Copy Markdown

@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

Comment thread src/hello.cpp
{
std::string m_string;
public:
X(const std::string& str) : m_string(str) {}
Copy link
Copy Markdown

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)) {}

Comment thread src/hello.cpp
{
std::string m_string;
public:
X(const std::string& str) : m_string(str) {}
Copy link
Copy Markdown

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