Skip to content

Check clang-tidy warnings too on CI #207

@ClausKlein

Description

@ClausKlein
bash-5.3$ run-clang-tidy -checks='-*,bugprone-*' examples
Enabled checks:
    bugprone-argument-comment
    bugprone-assert-side-effect
    bugprone-assignment-in-if-condition
    bugprone-bad-signal-to-kill-thread
    bugprone-bitwise-pointer-cast
    bugprone-bool-pointer-implicit-conversion
    bugprone-branch-clone
    bugprone-capturing-this-in-member-variable
    bugprone-casting-through-void
    bugprone-chained-comparison
    bugprone-compare-pointer-to-member-virtual-function
    bugprone-copy-constructor-init
    bugprone-crtp-constructor-accessibility
    bugprone-dangling-handle
    bugprone-dynamic-static-initializers
    bugprone-easily-swappable-parameters
    bugprone-empty-catch
    bugprone-exception-escape
    bugprone-fold-init-type
    bugprone-forward-declaration-namespace
    bugprone-forwarding-reference-overload
    bugprone-implicit-widening-of-multiplication-result
    bugprone-inaccurate-erase
    bugprone-inc-dec-in-conditions
    bugprone-incorrect-enable-if
    bugprone-incorrect-enable-shared-from-this
    bugprone-incorrect-roundings
    bugprone-infinite-loop
    bugprone-integer-division
    bugprone-lambda-function-name
    bugprone-macro-parentheses
    bugprone-macro-repeated-side-effects
    bugprone-misleading-setter-of-reference
    bugprone-misplaced-operator-in-strlen-in-alloc
    bugprone-misplaced-pointer-arithmetic-in-alloc
    bugprone-misplaced-widening-cast
    bugprone-move-forwarding-reference
    bugprone-multi-level-implicit-pointer-conversion
    bugprone-multiple-new-in-one-expression
    bugprone-multiple-statement-macro
    bugprone-narrowing-conversions
    bugprone-no-escape
    bugprone-non-zero-enum-to-bool-conversion
    bugprone-nondeterministic-pointer-iteration-order
    bugprone-not-null-terminated-result
    bugprone-optional-value-conversion
    bugprone-parent-virtual-call
    bugprone-pointer-arithmetic-on-polymorphic-object
    bugprone-posix-return
    bugprone-redundant-branch-condition
    bugprone-reserved-identifier
    bugprone-return-const-ref-from-parameter
    bugprone-shared-ptr-array-mismatch
    bugprone-signal-handler
    bugprone-signed-char-misuse
    bugprone-sizeof-container
    bugprone-sizeof-expression
    bugprone-spuriously-wake-up-functions
    bugprone-standalone-empty
    bugprone-string-constructor
    bugprone-string-integer-assignment
    bugprone-string-literal-with-embedded-nul
    bugprone-stringview-nullptr
    bugprone-suspicious-enum-usage
    bugprone-suspicious-include
    bugprone-suspicious-memory-comparison
    bugprone-suspicious-memset-usage
    bugprone-suspicious-missing-comma
    bugprone-suspicious-realloc-usage
    bugprone-suspicious-semicolon
    bugprone-suspicious-string-compare
    bugprone-suspicious-stringview-data-usage
    bugprone-swapped-arguments
    bugprone-switch-missing-default-case
    bugprone-tagged-union-member-count
    bugprone-terminating-continue
    bugprone-throw-keyword-missing
    bugprone-too-small-loop-variable
    bugprone-unchecked-optional-access
    bugprone-undefined-memory-manipulation
    bugprone-undelegated-constructor
    bugprone-unhandled-exception-at-new
    bugprone-unhandled-self-assignment
    bugprone-unintended-char-ostream-output
    bugprone-unique-ptr-array-mismatch
    bugprone-unsafe-functions
    bugprone-unused-local-non-trivial-variable
    bugprone-unused-raii
    bugprone-unused-return-value
    bugprone-use-after-move
    bugprone-virtual-near-miss

Running clang-tidy for 15 files out of 291 in compilation database ...
[ 1/15][5.2s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/stop_token.cpp
23301 warnings generated.
Suppressed 23301 warnings (23301 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[ 2/15][6.4s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/doc-just.cpp
30395 warnings generated.
Suppressed 30406 warnings (30395 in non-user code, 11 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[ 3/15][7.2s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/doc-just_stopped.cpp
31991 warnings generated.
Suppressed 32004 warnings (31991 in non-user code, 13 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[ 4/15][7.6s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/stackoverflow.cpp
/Users/clausklein/Workspace/cpp/beman-project/execution26/examples/stackoverflow.cpp:49:67: warning: forwarding reference passed to std::move(), which may unexpectedly cause lvalues to be moved; use std::forward() instead [bugprone-move-forwarding-reference]
   49 |         state(auto&& r, auto&& h) : r(std::forward<R>(r)), handle(std::move(h)) {}
      |                                                                   ^~~~~~~~~
      |                                                                   std::forward<decltype(h)>
31995 warnings generated.
Suppressed 32007 warnings (31994 in non-user code, 13 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[ 5/15][7.6s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/modules.cpp
32005 warnings generated.
Suppressed 32023 warnings (32005 in non-user code, 18 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[ 6/15][7.7s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/playground.cpp
32003 warnings generated.
Suppressed 32021 warnings (32003 in non-user code, 18 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[ 7/15][7.7s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/stopping.cpp
32825 warnings generated.
Suppressed 32838 warnings (32825 in non-user code, 13 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[ 8/15][7.7s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/sender-demo.cpp
32091 warnings generated.
Suppressed 32106 warnings (32091 in non-user code, 15 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[ 9/15][7.8s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/intro-5-consumer.cpp
/Users/clausklein/Workspace/cpp/beman-project/execution26/examples/intro-5-consumer.cpp:31:10: warning: an exception may be thrown in function 'value_or' which should not throw exceptions [bugprone-exception-escape]
   31 |     auto value_or(T&& default_value) & noexcept -> T {
      |          ^
/usr/local/Cellar/llvm/21.1.8/bin/../include/c++/v1/variant:313:3: note: frame #0: unhandled exception of type 'std::bad_variant_access' may be thrown in function '__throw_bad_variant_access' here
  313 |   throw bad_variant_access();
      |   ^
/usr/local/Cellar/llvm/21.1.8/bin/../include/c++/v1/variant:1342:5: note: frame #1: function '__generic_get<1UL, std::variant<std::monostate, success, failure> &>' calls function '__throw_bad_variant_access' here
 1342 |     std::__throw_bad_variant_access();
      |     ^
/usr/local/Cellar/llvm/21.1.8/bin/../include/c++/v1/variant:1351:10: note: frame #2: function 'get<1UL, std::monostate, success, failure>' calls function '__generic_get<1UL, std::variant<std::monostate, success, failure> &>' here
 1351 |   return std::__generic_get<_Ip>(__v);
      |          ^
/Users/clausklein/Workspace/cpp/beman-project/execution26/examples/intro-5-consumer.cpp:33:20: note: frame #3: function 'value_or' calls function 'get<1UL, std::monostate, success, failure>' here
   33 |             return std::get<1>(this->value_or_error);
      |                    ^
/Users/clausklein/Workspace/cpp/beman-project/execution26/examples/intro-5-consumer.cpp:45:10: warning: an exception may be thrown in function 'error_or' which should not throw exceptions [bugprone-exception-escape]
   45 |     auto error_or(E&& default_error) & noexcept -> E {
      |          ^
/usr/local/Cellar/llvm/21.1.8/bin/../include/c++/v1/variant:313:3: note: frame #0: unhandled exception of type 'std::bad_variant_access' may be thrown in function '__throw_bad_variant_access' here
  313 |   throw bad_variant_access();
      |   ^
/usr/local/Cellar/llvm/21.1.8/bin/../include/c++/v1/variant:1342:5: note: frame #1: function '__generic_get<2UL, std::variant<std::monostate, success, failure> &>' calls function '__throw_bad_variant_access' here
 1342 |     std::__throw_bad_variant_access();
      |     ^
/usr/local/Cellar/llvm/21.1.8/bin/../include/c++/v1/variant:1351:10: note: frame #2: function 'get<2UL, std::monostate, success, failure>' calls function '__generic_get<2UL, std::variant<std::monostate, success, failure> &>' here
 1351 |   return std::__generic_get<_Ip>(__v);
      |          ^
/Users/clausklein/Workspace/cpp/beman-project/execution26/examples/intro-5-consumer.cpp:47:20: note: frame #3: function 'error_or' calls function 'get<2UL, std::monostate, success, failure>' here
   47 |             return std::get<2>(this->value_or_error);
      |                    ^
32858 warnings generated.
Suppressed 32872 warnings (32856 in non-user code, 16 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[10/15][7.9s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/allocator.cpp
32611 warnings generated.
Suppressed 32628 warnings (32611 in non-user code, 17 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[11/15][8.1s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/inspect.cpp
31992 warnings generated.
Suppressed 32017 warnings (31992 in non-user code, 25 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[12/15][8.7s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/intro-2-hello-async.cpp
34496 warnings generated.
Suppressed 34524 warnings (34496 in non-user code, 28 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[13/15][4.9s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/doc-just_error.cpp
30395 warnings generated.
Suppressed 30408 warnings (30395 in non-user code, 13 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[14/15][4.9s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/intro-1-hello-world.cpp
32003 warnings generated.
Suppressed 32021 warnings (32003 in non-user code, 18 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[15/15][4.4s] /usr/local/Cellar/llvm/21.1.8/bin/clang-tidy -checks=-*,bugprone-* -p=/Users/clausklein/Workspace/cpp/beman-project/execution26 /Users/clausklein/Workspace/cpp/beman-project/execution26/examples/when_all-cancel.cpp
31997 warnings generated.
Suppressed 32008 warnings (31997 in non-user code, 11 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

bash-5.3$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions