Skip to content

⬆️ Update clang-tidy to version 23 - #2328

Draft
simon1hofmann wants to merge 24 commits into
mainfrom
codex/clang-tidy-23
Draft

⬆️ Update clang-tidy to version 23#2328
simon1hofmann wants to merge 24 commits into
mainfrom
codex/clang-tidy-23

Conversation

@simon1hofmann

@simon1hofmann simon1hofmann commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Description

This draft exercises MQT Core with clang-tidy 23 before the shared workflow is released.

  • update the local cpp-lint session to require clang-tidy 23
  • temporarily pin the C++ linter job to ♻️ Directly pass the LLVM installation directory to cpp-linter workflows#448 at 478992868226029b1e19d423d2dda2767e67670c
  • temporarily lint the complete C++ tree so new diagnostics are visible
  • explicitly enable all four new LLVM checks where applicable: llvm-formatv-string, llvm-redundant-casting, llvm-type-switch-case-types, and llvm-use-vector-utils

llvm-type-switch-case-types is intentionally included in the canary even though MQT Core has well over 200 candidate TypeSwitch::Case sites. Typed-lambda findings should be automatically fixable, while generic-lambda findings are warning-only. This lets the decision whether to retain that style check be based on the actual report.

Before this PR is marked ready, the temporary workflow pin will be replaced with the released workflow revision, changed-file filtering will be restored, and any Clang 23 findings will be addressed or documented.

Depends on munich-quantum-toolkit/workflows#448.

LLVM 23 release-note audit

  • all configured check names and options remain valid in Clang 23
  • remove the now-redundant google-explicit-constructor config alias and update existing suppressions to the canonical misc-explicit-constructor name
  • the performance-faster-string-find rename requires no edit because performance-* selects performance-prefer-single-char-overloads
  • account for five checks relocated from the removed hicpp module that are newly selected by existing wildcards
  • retain broadened defaults during the canary so the Clang 23 delta remains visible

Canary results

The first full-tree run successfully used clang-tidy 23.1.1 from /usr/lib/llvm-23/bin and reported 673 clang-tidy findings and no clang-format findings. The main groups were:

  • 318 misc-const-correctness
  • 243 readability-trailing-comma
  • 54 readability-redundant-lambda-parameter-list
  • 32 bugprone-signed-bitwise
  • 11 readability-redundant-parentheses

The remaining 15 findings were spread across eight checks. A follow-up canary with all four new LLVM checks enabled is in progress.

Validation

  • uvx nox -s lint
  • mirrored mlir/.clang-tidy and bindings/mlir/.clang-tidy configurations verified identical

The clang-tidy 23 full-tree run is intentionally delegated to this draft PR's C++ linter job.

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed). (Not needed.)
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • I have disclosed AI assistance in the PR description.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v23.1.1) reports: 1503 concern(s)
  • test/qdmi/devices/dd/device_status_test.cpp:49:25: warning: [readability-redundant-lambda-parameter-list]

    redundant empty parameter list in lambda expression

       49 |   std::thread poller([&]() {
          |                         ^~
  • mlir/unittests/Conversion/JeffRoundTrip/test_jeff_round_trip.cpp:411:19: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      411 |            strings},
          |                   ^
          |                   ,
  • mlir/unittests/Conversion/JeffRoundTrip/test_jeff_round_trip.cpp:416:77: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      416 |                        builder.getArrayAttr({builder.getI32IntegerAttr(0)}))},
          |                                                                             ^
          |                                                                             ,
  • mlir/lib/Dialect/QTensor/Transforms/ShrinkRegisters.cpp:83:26: warning: [modernize-use-designated-initializers]

    use designated initializer list to initialize 'ValueParamT' (aka 'mlir::qtensor::(anonymous namespace)::TensorAccess')

       83 |       accesses.push_back({extractOp, *index});
          |                          ^~~~~~~~~~~~~~~~~~~
          |                           .operation=.index=
    /home/runner/work/core/core/mlir/lib/Dialect/QTensor/Transforms/ShrinkRegisters.cpp:50:1: note: aggregate type is defined here
       50 | struct TensorAccess {
          | ^
  • mlir/lib/Dialect/QTensor/Transforms/ShrinkRegisters.cpp:96:26: warning: [modernize-use-designated-initializers]

    use designated initializer list to initialize 'ValueParamT' (aka 'mlir::qtensor::(anonymous namespace)::TensorAccess')

       96 |       accesses.push_back({insertOp, *index});
          |                          ^~~~~~~~~~~~~~~~~~
          |                           .operation= .index=
    /home/runner/work/core/core/mlir/lib/Dialect/QTensor/Transforms/ShrinkRegisters.cpp:50:1: note: aggregate type is defined here
       50 | struct TensorAccess {
          | ^
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:77:10: warning: [llvm-use-vector-utils]

    use 'filter_to_vector'

       11 |   return to_vector(llvm::make_filter_range(
          |          ^~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
          |          filter_to_vector
       12 |       values, [](Value value) { return isa<QubitType>(value.getType()); }));
          |                                                                          ~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:136:16: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      136 |               .Case<qco::IfOp>([&](qco::IfOp ifOp) { return ifOp.getQubits(); })
          |                ^   ~~~~~~~~~~~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:137:16: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      137 |               .Case<qco::IndexSwitchOp>([&](qco::IndexSwitchOp switchOp) {
          |                ^   ~~~~~~~~~~~~~~~~~~~~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:140:16: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      140 |               .Case<scf::WhileOp>(
          |                ^   ~~~~~~~~~~~~~~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:142:16: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      142 |               .Case<scf::ForOp>(
          |                ^   ~~~~~~~~~~~~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:146:41: warning: [llvm-use-vector-utils]

    use 'map_to_vector'

      146 |       const auto initialHardwareOrder = to_vector(llvm::map_range(
          |                                         ^~~~~~~~~ ~~~~~~~~~~~~~~~~
          |                                         map_to_vector
      147 |           getQubitValues(initArgs), [&](auto v) { return m.at(v); }));
          |                                                                    ~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:166:16: warning: [llvm-type-switch-case-types]

    lambda parameter needlessly uses 'auto', use explicit type instead

      166 |               .Case<scf::WhileOp>([&](auto) {
          |                ^
    /home/runner/work/core/core/mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:166:39: note: replace 'auto' with explicit type
      166 |               .Case<scf::WhileOp>([&](auto) {
          |                                       ^
    /home/runner/work/core/core/mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:166:21: note: type from template argument can be inferred and removed
      166 |               .Case<scf::WhileOp>([&](auto) {
          |                     ^
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:172:16: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      172 |               .Case<scf::ForOp>([&](scf::ForOp) {
          |                ^   ~~~~~~~~~~~~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:178:11: warning: [llvm-use-vector-utils]

    use 'map_to_vector'

      178 |           to_vector(llvm::map_range(getQubitValues(finalOrderArgs),
          |           ^~~~~~~~~ ~~~~~~~~~~~~~~~~
          |           map_to_vector
      179 |                                     [&](auto v) { return localM.at(v); }));
          |                                                                         ~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:203:16: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      203 |               .Case<scf::WhileOp>([&](scf::WhileOp whileOp) {
          |                ^   ~~~~~~~~~~~~~~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:206:16: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      206 |               .Case<scf::ForOp>([&](scf::ForOp forOp) {
          |                ^   ~~~~~~~~~~~~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:209:16: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      209 |               .Case<qco::IfOp>(
          |                ^   ~~~~~~~~~~~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:211:16: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      211 |               .Case<qco::IndexSwitchOp>([&](qco::IndexSwitchOp switchOp) {
          |                ^   ~~~~~~~~~~~~~~~~~~~~
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:494:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      492 |   auto qubit = builder.h(builder.allocQubit());
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      493 |   Value bit;
          |   ~~~~~~~~~~
      494 |   std::tie(qubit, bit) = builder.measure(qubit);
          |   ^~~~~~~~~~~~~~~~~~~~
          |   auto [qubit, bit]
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:517:69: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      517 |                     llvm::cantFail(CompilerTarget::Site::create(81))};
          |                                                                     ^
          |                                                                     ,
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:624:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      622 |   Value q0 = builder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      623 |   Value q1 = builder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      624 |   std::tie(q0, q1) = builder.cx(q0, q1);
          |   ^~~~~~~~~~~~~~~~
          |   auto [q0, q1]
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp:875:49: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      875 |                             builder.allocQubit()};
          |                                                 ^
          |                                                 ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:80:28: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

       80 |               rewriter, loc};
          |                            ^
          |                            ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:88:28: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

       88 |               rewriter, loc};
          |                            ^
          |                            ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:96:28: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

       96 |               rewriter, loc};
          |                            ^
          |                            ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:104:28: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      104 |               rewriter, loc};
          |                            ^
          |                            ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:112:18: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      112 |               loc};
          |                  ^
          |                  ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:121:18: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      121 |               loc};
          |                  ^
          |                  ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:129:18: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      129 |               loc};
          |                  ^
          |                  ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:137:18: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      137 |               loc};
          |                  ^
          |                  ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:145:18: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      145 |               loc};
          |                  ^
          |                  ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:153:18: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      153 |               loc};
          |                  ^
          |                  ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:162:28: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      162 |               rewriter, loc};
          |                            ^
          |                            ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:170:28: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      170 |               rewriter, loc};
          |                            ^
          |                            ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:178:28: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      178 |               rewriter, loc};
          |                            ^
          |                            ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:225:28: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      225 |           t.rewriter, t.loc};
          |                            ^
          |                            ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:273:36: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      273 |           .pi = c(std::numbers::pi)};
          |                                    ^
          |                                    ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:371:8: warning: [llvm-type-switch-case-types]

    lambda parameter needlessly uses 'auto', use explicit type instead

      371 |       .Case<RXOp>([](auto) { return RotationAxis::X; })
          |        ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:371:22: note: replace 'auto' with explicit type
      371 |       .Case<RXOp>([](auto) { return RotationAxis::X; })
          |                      ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:371:13: note: type from template argument can be inferred and removed
      371 |       .Case<RXOp>([](auto) { return RotationAxis::X; })
          |             ^
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:372:8: warning: [llvm-type-switch-case-types]

    lambda parameter needlessly uses 'auto', use explicit type instead

      372 |       .Case<RYOp>([](auto) { return RotationAxis::Y; })
          |        ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:372:22: note: replace 'auto' with explicit type
      372 |       .Case<RYOp>([](auto) { return RotationAxis::Y; })
          |                      ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:372:13: note: type from template argument can be inferred and removed
      372 |       .Case<RYOp>([](auto) { return RotationAxis::Y; })
          |             ^
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:429:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      429 |       .template Case<XOp>([&](XOp) {
          |        ~~~~~~~~ ^   ~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:432:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      432 |       .template Case<YOp>([&](YOp) {
          |        ~~~~~~~~ ^   ~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:435:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      435 |       .template Case<ZOp>([&](ZOp) {
          |        ~~~~~~~~ ^   ~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:438:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      438 |       .template Case<SOp>([&](SOp) {
          |        ~~~~~~~~ ^   ~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:441:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      441 |       .template Case<SdgOp>([&](SdgOp) {
          |        ~~~~~~~~ ^   ~~~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:444:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      444 |       .template Case<TOp>([&](TOp) {
          |        ~~~~~~~~ ^   ~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:447:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      447 |       .template Case<TdgOp>([&](TdgOp) {
          |        ~~~~~~~~ ^   ~~~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:450:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      450 |       .template Case<SXOp>([&](SXOp) {
          |        ~~~~~~~~ ^   ~~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:453:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      453 |       .template Case<SXdgOp>([&](SXdgOp) {
          |        ~~~~~~~~ ^   ~~~~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:456:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      456 |       .template Case<HOp>([&](HOp) -> std::optional<Quat<T>> {
          |        ~~~~~~~~ ^   ~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:460:71: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      460 |             .w = c.zero, .x = invSqrtTwo, .y = c.zero, .z = invSqrtTwo};
          |                                                                       ^
          |                                                                       ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:462:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      462 |       .template Case<IdOp>([&](IdOp) -> std::optional<Quat<T>> {
          |        ~~~~~~~~ ^   ~~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:465:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      465 |       .template Case<ROp>([&](ROp) -> std::optional<Quat<T>> {
          |        ~~~~~~~~ ^   ~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:476:35: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      476 |                        .z = c.zero};
          |                                   ^
          |                                   ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:478:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      478 |       .template Case<U2Op>([&](U2Op) -> std::optional<Quat<T>> {
          |        ~~~~~~~~ ^   ~~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:486:17: warning: [llvm-type-switch-case-types]

    redundant explicit template argument

      486 |       .template Case<UOp>([&](UOp) -> std::optional<Quat<T>> {
          |        ~~~~~~~~ ^   ~~~~~
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:536:17: warning: [llvm-type-switch-case-types]

    lambda parameter needlessly uses 'auto', use explicit type instead

      536 |       .template Case<TOp>([&](auto) -> FailureOr<Val<T>> {
          |                 ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:536:31: note: replace 'auto' with explicit type
      536 |       .template Case<TOp>([&](auto) -> FailureOr<Val<T>> {
          |                               ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:536:22: note: type from template argument can be inferred and removed
      536 |       .template Case<TOp>([&](auto) -> FailureOr<Val<T>> {
          |                      ^
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:539:17: warning: [llvm-type-switch-case-types]

    lambda parameter needlessly uses 'auto', use explicit type instead

      539 |       .template Case<TdgOp>([&](auto) -> FailureOr<Val<T>> {
          |                 ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:539:33: note: replace 'auto' with explicit type
      539 |       .template Case<TdgOp>([&](auto) -> FailureOr<Val<T>> {
          |                                 ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:539:22: note: type from template argument can be inferred and removed
      539 |       .template Case<TdgOp>([&](auto) -> FailureOr<Val<T>> {
          |                      ^
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:542:17: warning: [llvm-type-switch-case-types]

    lambda parameter needlessly uses 'auto', use explicit type instead

      542 |       .template Case<IdOp>([&](auto) -> FailureOr<Val<T>> { return c.zero; })
          |                 ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:542:32: note: replace 'auto' with explicit type
      542 |       .template Case<IdOp>([&](auto) -> FailureOr<Val<T>> { return c.zero; })
          |                                ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:542:22: note: type from template argument can be inferred and removed
      542 |       .template Case<IdOp>([&](auto) -> FailureOr<Val<T>> { return c.zero; })
          |                      ^
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:543:17: warning: [llvm-type-switch-case-types]

    lambda parameter needlessly uses 'auto', use explicit type instead

      543 |       .template Case<POp>([&](auto) -> FailureOr<Val<T>> {
          |                 ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:543:31: note: replace 'auto' with explicit type
      543 |       .template Case<POp>([&](auto) -> FailureOr<Val<T>> {
          |                               ^
    /home/runner/work/core/core/mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:543:22: note: type from template argument can be inferred and removed
      543 |       .template Case<POp>([&](auto) -> FailureOr<Val<T>> {
          |                      ^
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:778:71: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      778 |         .v = op.getParameter(index), .rewriter = &rewriter, .loc = loc};
          |                                                                       ^
          |                                                                       ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:794:29: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      794 |               .phase = phase};
          |                             ^
          |                             ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:799:29: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      799 |               .phase = phase};
          |                             ^
          |                             ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:809:33: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      809 |             .phase = consts.zero};
          |                                 ^
          |                                 ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:817:57: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      817 |             .phase = sumAngles(phi, lambda) / consts.two};
          |                                                         ^
          |                                                         ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:826:55: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      826 |           .phase = sumAngles(phi, lambda) / consts.two};
          |                                                       ^
          |                                                       ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:835:71: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      835 |         .v = op.getParameter(index), .rewriter = &rewriter, .loc = loc};
          |                                                                       ^
          |                                                                       ,
  • mlir/lib/Dialect/QCO/Transforms/Optimizations/MergeSingleQubitRotationGates.cpp:1076:69: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1076 |                                     .phase = phaseAccum + eulerPhase};
          |                                                                     ^
          |                                                                     ,
  • mlir/unittests/Dialect/MQT/Transforms/test_global_phase_normalization.cpp:317:43: warning: [readability-redundant-lambda-parameter-list]

    redundant empty parameter list in lambda expression

      317 |   const auto countOperations = [&moduleOp]() {
          |                                           ^~
  • mlir/unittests/Dialect/MQT/Transforms/test_global_phase_normalization.cpp:878:77: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      878 |                              2.0 * std::numbers::pi, -2.0 * std::numbers::pi}) {
          |                                                                             ^
          |                                                                             ,
  • mlir/unittests/Dialect/MQT/Transforms/test_global_phase_normalization.cpp:944:50: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      944 |           std::numeric_limits<double>::infinity()}) {
          |                                                  ^
          |                                                  ,
  • src/dd/CachedEdge.cpp:105:72: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      105 |                  e[2].w.approximatelyZero(), e[3].w.approximatelyZero()};
          |                                                                        ^
          |                                                                        ,
  • mlir/lib/Dialect/QTensor/IR/Operations/AllocOp.cpp:40:21: warning: [llvm-redundant-casting]

    redundant use of 'cast'

       40 |   auto resultType = cast<RankedTensorType>(getResult().getType());
          |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                     getResult().getType()
    /home/runner/work/core/core/mlir/lib/Dialect/QTensor/IR/Operations/AllocOp.cpp:40:44: note: source expression has type 'mlir::RankedTensorType'
       40 |   auto resultType = cast<RankedTensorType>(getResult().getType());
          |                                            ^~~~~~~~~~~~~~~~~~~~~
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1113:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1113 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1116:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1116 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1122:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1122 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1132:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1132 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1138:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1138 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1144:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1144 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1151:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1151 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1157:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1157 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1164:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1164 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1170:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1170 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1184:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1184 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1193:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1193 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1202:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1202 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1211:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1211 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1217:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1217 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1229:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1229 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1241:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1241 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1254:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1254 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1265:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1265 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1274:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1274 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1285:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1285 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1291:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1291 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QC/Translation/test_openqasm3_emission.cpp:1296:14: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     1296 |       })mlir"},
          |              ^
          |              ,
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:135:56: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      135 |                              programBuilder.getI1Type()});
          |                                                        ^
          |                                                        ,
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:142:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      140 |   SmallVector<Value> q12;
          |   ~~~~~~~~~~~~~~~~~~~~~~~
      141 |   SmallVector<Value> q0Vec;
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~
      142 |   std::tie(q12, q0Vec) =
          |   ^~~~~~~~~~~~~~~~~~~~
          |   auto [q12, q0Vec]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:174:60: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      174 |                                referenceBuilder.getI1Type()});
          |                                                            ^
          |                                                            ,
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:184:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      182 |   SmallVector<Value> r12;
          |   ~~~~~~~~~~~~~~~~~~~~~~~
      183 |   SmallVector<Value> r0Vec;
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~
      184 |   std::tie(r12, r0Vec) =
          |   ^~~~~~~~~~~~~~~~~~~~
          |   auto [r12, r0Vec]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:233:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      231 |   SmallVector<Value> q12;
          |   ~~~~~~~~~~~~~~~~~~~~~~~
      232 |   SmallVector<Value> q0Vec;
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~
      233 |   std::tie(q12, q0Vec) =
          |   ^~~~~~~~~~~~~~~~~~~~
          |   auto [q12, q0Vec]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:261:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      259 |   SmallVector<Value> r12;
          |   ~~~~~~~~~~~~~~~~~~~~~~~
      260 |   SmallVector<Value> r0Vec;
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~
      261 |   std::tie(r12, r0Vec) =
          |   ^~~~~~~~~~~~~~~~~~~~
          |   auto [r12, r0Vec]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:289:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      286 |   auto q0 = programBuilder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      287 |   auto q1 = programBuilder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      288 | 
      289 |   std::tie(q0, q1) = programBuilder.crx(std::numbers::pi / 2, q0, q1);
          |   ^~~~~~~~~~~~~~~~
          |   auto [q0, q1]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:410:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      408 |   auto r = referenceBuilder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      409 |   Value cr;
          |   ~~~~~~~~~
      410 |   std::tie(r, cr) = referenceBuilder.measure(r);
          |   ^~~~~~~~~~~~~~~
          |   auto [r, cr]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:442:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      440 |   auto r = referenceBuilder.h(referenceBuilder.allocQubit());
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      441 |   Value referenceFirstOutcome;
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      442 |   std::tie(r, referenceFirstOutcome) = referenceBuilder.measure(r);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |   auto [r, referenceFirstOutcome]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:472:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      470 |   auto r = referenceBuilder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      471 |   Value cr;
          |   ~~~~~~~~~
      472 |   std::tie(r, cr) = referenceBuilder.measure(r);
          |   ^~~~~~~~~~~~~~~
          |   auto [r, cr]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:492:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      489 |   auto q0 = programBuilder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      490 |   auto q1 = programBuilder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      491 | 
      492 |   std::tie(q0, q1) = programBuilder.cy(q0, q1);
          |   ^~~~~~~~~~~~~~~~
          |   auto [q0, q1]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:535:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      532 |   auto q0 = programBuilder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      533 |   auto q1 = programBuilder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      534 | 
      535 |   std::tie(q0, q1) = programBuilder.cz(q0, q1);
          |   ^~~~~~~~~~~~~~~~
          |   auto [q0, q1]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:576:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      574 |   auto control = programBuilder.h(programBuilder.allocQubit());
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      575 |   auto target = programBuilder.x(programBuilder.allocQubit());
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      576 |   std::tie(control, target) = programBuilder.cz(control, target);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~
          |   auto [control, target]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:592:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      590 |   auto referenceTarget = referenceBuilder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      591 |   Value rawTargetOutcome;
          |   ~~~~~~~~~~~~~~~~~~~~~~~
      592 |   std::tie(referenceTarget, rawTargetOutcome) =
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |   auto [referenceTarget, rawTargetOutcome]
  • mlir/unittests/Dialect/QCO/Transforms/Optimizations/test_qco_measurement_lifting.cpp:681:3: warning: [modernize-use-structured-binding]

    use a structured binding to decompose a pair

      679 |   auto r = referenceBuilder.allocQubit();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      680 |   Value cr;
          |   ~~~~~~~~~
      681 |   std::tie(r, cr) = referenceBuilder.measure(r);
          |   ^~~~~~~~~~~~~~~
          |   auto [r, cr]
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:515:56: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      515 |        .source = "OPENQASM 3.1; include \"missing.inc;"},
          |                                                        ^
          |                                                        ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:517:58: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      517 |        .source = "OPENQASM 3.1; include \"missing.inc\";"},
          |                                                          ^
          |                                                          ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:519:47: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      519 |        .source = "OPENQASM 3.1; qubit q; x $;"},
          |                                               ^
          |                                               ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:521:56: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      521 |        .source = "OPENQASM 3.1; float value = 1e99999;"},
          |                                                        ^
          |                                                        ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:523:49: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      523 |        .source = "OPENQASM 3.1; duration delay;"},
          |                                                 ^
          |                                                 ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:525:50: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      525 |        .source = "OPENQASM 3.1; opaque custom q;"},
          |                                                  ^
          |                                                  ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:530:55: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      530 |        .source = "OPENQASM 3.1; include stdgates.inc;"},
          |                                                       ^
          |                                                       ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:532:53: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      532 |        .source = "OPENQASM 3.1; gate custom[2] q {}"},
          |                                                     ^
          |                                                     ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:534:53: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      534 |        .source = "OPENQASM 3.1; for int i in [:] {}"},
          |                                                     ^
          |                                                     ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:536:45: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      536 |        .source = "OPENQASM 3.1; while () {}"},
          |                                             ^
          |                                             ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:538:66: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      538 |        .source = "OPENQASM 3.1; int value = 0; switch (value) {}"},
          |                                                                  ^
          |                                                                  ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:541:42: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      541 |                  "default {} case 0 {} }"},
          |                                          ^
          |                                          ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:544:53: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      544 |                  "case 0 {} default {} default {} }"},
          |                                                     ^
          |                                                     ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_parser.cpp:546:50: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      546 |        .source = "OPENQASM 3.1; const int value;"},
          |                                                  ^
          |                                                  ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_emitter.cpp:2607:78: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     2607 |        .conditionals = {.semantic = 0, .dispatch = 0, .whileMeasurements = 0}},
          |                                                                              ^
          |                                                                              ,
  • mlir/unittests/Target/OpenQASM/test_openqasm_emitter.cpp:2613:78: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

     2613 |        .conditionals = {.semantic = 1, .dispatch = 0, .whileMeasurements = 0}},
          |                                                                              ^
          |                                                                              ,
  • src/bench/JSON.cpp:255:33: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      255 |                      "reference"},
          |                                 ^
          |                                 ,
  • src/bench/JSON.cpp:295:77: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      295 |                                     source, "$/parameters/hidden_bitstring")};
          |                                                                             ^
          |                                                                             ,
  • src/bench/JSON.cpp:320:56: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      320 |                          source, "$/parameters/qubits")};
          |                                                        ^
          |                                                        ,
  • src/bench/JSON.cpp:356:51: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      356 |           source, "$/parameters/marked_bitstring")};
          |                                                   ^
          |                                                   ,
  • src/bench/JSON.cpp:376:75: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      376 |                                             source, "$/parameters/qubits")});
          |                                                                           ^
          |                                                                           ,
  • src/bench/JSON.cpp:392:50: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      392 |           source, "$/parameters/period_exponent")};
          |                                                  ^
          |                                                  ,
  • src/bench/JSON.cpp:443:33: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      443 |                 .method = method});
          |                                 ^
          |                                 ,
  • src/bench/JSON.cpp:449:15: warning: [modernize-use-string-view]

    consider using 'std::string_view' to avoid unnecessary copying and allocations

      449 | [[nodiscard]] std::string topologyName(const GHZTopology topology) {
          |               ^~~~~~~~~~~
          |               std::string_view
  • src/bench/JSON.cpp:453:15: warning: [modernize-use-string-view]

    consider using 'std::string_view' to avoid unnecessary copying and allocations

      453 | [[nodiscard]] std::string basisName(const GHZBasis basis) {
          |               ^~~~~~~~~~~
          |               std::string_view
  • src/bench/JSON.cpp:472:49: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      472 |           {"method", methodName(options.method)}};
          |                                                 ^
          |                                                 ,
  • src/bench/JSON.cpp:479:55: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      479 |           {"topology", topologyName(options.topology)}};
          |                                                       ^
          |                                                       ,
  • src/bench/JSON.cpp:485:56: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      485 |           {"marked_bitstring", options.markedBitstring}};
          |                                                        ^
          |                                                        ,
  • src/bench/JSON.cpp:496:37: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      496 |           {"qubits", options.qubits}};
          |                                     ^
          |                                     ,
  • src/bench/JSON.cpp:504:53: warning: [readability-trailing-comma]

    initializer list should have a trailing comma

      504 |             {"numerator", options.phase.numerator()}}},
          |                                                     ^
          |                                                     ,

Have any feedback or feature suggestions? Share it here.

@burgholzer

Copy link
Copy Markdown
Member

Side note here: It may be worth checking https://releases.llvm.org/23.1.0/tools/clang/tools/extra/docs/ReleaseNotes.html for checks that we should be explicitly enabling (e.g. a couple of the new LLVM checks)

@burgholzer burgholzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just two small comments on some new rules that should likely be enabled as well.
Edit: This should have only been a comment and not an approval; that then still needs all the fixes 🙃

Comment thread mlir/.clang-tidy Outdated
Comment thread mlir/.clang-tidy
Temporarily run the complete C++ tree against the unreleased workflows change to surface new diagnostics.

Assisted-by: GPT-5.6 Sol via Codex
Assisted-by: GPT-5.6 Sol via Codex
Enable the new format string, redundant casting, and vector utility checks where they apply without opting into the complete LLVM check family.

Assisted-by: GPT-5.6 Sol via Codex
Include both fixable redundant template arguments and generic-lambda warnings in the Clang 23 canary so the final policy can be based on actual findings.

Assisted-by: GPT-5.6 Sol via Codex
Clang 23 registers misc-explicit-constructor through the existing misc wildcard, making the retained google alias redundant.

Assisted-by: GPT-5.6 Sol via Codex
Update clang-tidy suppressions from the retained Google alias to the Clang 23 misc check name.

Assisted-by: GPT-5.6 Sol via Codex
Enable all modernize checks except trailing return types and add the trailing-comma readability check in both mirrored MLIR profiles.

Assisted-by: GPT-5.6 Sol via Codex
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Important

Approval pending

CodeRabbit has no unresolved comments, but it has not reviewed the latest commit.

Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify mergify Bot removed the conflict label Sep 4, 2026
Apply the Clang 23 readability fix to lambdas whose empty parameter lists are optional in C++20.

Assisted-by: GPT-5.6 Sol via Codex
Replace nested to_vector map and filter ranges with the dedicated LLVM helpers suggested by clang-tidy 23.

Assisted-by: GPT-5.6 Sol via Codex
Infer single Case types from explicit lambda parameters and replace generic lambda parameters with their MLIR handle types.

Assisted-by: GPT-5.6 Sol via Codex
Avoid constructing temporary single-character strings in the OpenQASM stress tests.

Assisted-by: GPT-5.6 Sol via Codex
Apply Clang 23 trailing-comma fix-its and keep single-line lists unchanged to avoid removing syntactically required separator commas.

Assisted-by: GPT-5.6 Sol via Codex
Rename structured-binding locals that Clang 23 identifies as member-style names.

Assisted-by: GPT-5.6 Sol via Codex
Document that every consuming visitor branch already forwards its input and silence Clang 23 for the generic lambda.

Assisted-by: GPT-5.6 Sol via Codex
Let Clang 23 infer the already-known MLIR wrapper types instead of recasting them.

Assisted-by: GPT-5.6 Sol via Codex
Avoid repeating MLIR operation wrapper return types where the function already determines the target Value type.

Assisted-by: GPT-5.6 Sol via Codex
Return views or static string literals from helpers whose results do not require ownership.

Assisted-by: GPT-5.6 Sol via Codex
Use class template argument deduction for the fixed QDMI result sets in device tests.

Assisted-by: GPT-5.6 Sol via Codex
Use C++20 designators for local aggregates so field assignments remain clear if their declarations evolve.

Assisted-by: GPT-5.6 Sol via Codex
Spell out the external KV aggregate fields required by the Clang 23 designated-initializer check.

Assisted-by: GPT-5.6 Sol via Codex
Rely on standard postfix and unary operator precedence in iterator expressions.

Assisted-by: GPT-5.6 Sol via Codex
Name compound predicates where needed and preserve short-circuiting while reducing control-flow nesting.

Assisted-by: GPT-5.6 Sol via Codex
Iterate directly when neither the mapping heuristic nor the program builder consumes an element index.

Assisted-by: GPT-5.6 Sol via Codex
Back NumPy matrix views with capsule-owned dd::CVec instances instead of C-style dynamic arrays.

Assisted-by: GPT-5.6 Sol via Codex
@mergify mergify Bot added the conflict label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants