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

Fixed some clang-tidy warnings #1627

Closed
wants to merge 2 commits into from
Closed

Fixed some clang-tidy warnings #1627

wants to merge 2 commits into from

Conversation

gabime
Copy link
Contributor

@gabime gabime commented Apr 10, 2020

No description provided.

@vitaut
Copy link
Contributor

vitaut commented Apr 11, 2020

Looks good, but could you post the warnings and the repro command?

@gabime
Copy link
Contributor Author

gabime commented Apr 11, 2020

They come from google-explicit-constructor (google-*) and readability-isolate-declaration (readability-*) checks :

warning: single-argument constructors must be marked explicit to avoid unintentional implicit conversions [google-explicit-constructor]
    constexpr sprintf_specs(basic_format_specs<Char> specs)
              ^
              explicit 

and

warning: multiple declarations in a single statement reduces readability [readability-isolate-declaration]
                auto p = buf.data(), end = p + n;
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@vitaut
Copy link
Contributor

vitaut commented Apr 12, 2020

Merged with minor tweaks, thanks.

@vitaut vitaut closed this Apr 12, 2020
@gabime
Copy link
Contributor Author

gabime commented Apr 12, 2020

The pointer specifier was to avoid another clang tidy warning that gets triggered if removed ..

@vitaut
Copy link
Contributor

vitaut commented Apr 12, 2020

What's the warning?

@gabime
Copy link
Contributor Author

gabime commented Apr 12, 2020

readability-qualified-auto

warning: 'auto p' can be declared as 'auto *p' [readability-qualified-auto]
                auto p = buf.data();
                ^~~~~
                auto *
warning: 'auto end' can be declared as 'auto *end' [readability-qualified-auto]
                auto end = p + n;
                ^~~~~
                auto *

@vitaut
Copy link
Contributor

vitaut commented Apr 12, 2020

Reapplied the auto change.

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.

None yet

2 participants