[clang-tools-extra] [clang-tidy] comment braced-init list arguments (PR #180408)
Julian Schmidt via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 15 16:16:21 PDT 2026
https://github.com/5chmidti commented:
The implementation is basically LGTM, but I'd prefer if we can make the `literal` part of the message when adding a comment optional. The init lists/ctors are not really literals. E.g., `shouldAddComment` could return an enum or string and the diag message could dispatch to `literal`, and for the initiatlizers maybe `temporary` with `%select`.
I think the check docs should be slightly revised to say that both mismatched comments and optionally enabled missing comments for literals and some constructed temporaries.
Regarding what @localspook brought up about diagnosing `Foo{}` but not `Foo()`, I think we should be diagnosing both as well. While I think most of the time the type will suffice, if a user has the option to diagnose `Foo{}` but not `Foo()`, I can already see the issue open by next release.
https://github.com/llvm/llvm-project/pull/180408
More information about the cfe-commits
mailing list