[clang-tools-extra] [clang-tidy] comment braced and parenthesized init arguments (PR #180408)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 11 02:43:32 PDT 2026


================
@@ -295,14 +373,20 @@ void ArgumentCommentCheck::checkCallArgs(ASTContext *Ctx,
       }
     }
 
-    // If the argument comments are missing for literals add them.
-    if (Comments.empty() && shouldAddComment(Args[I])) {
+    // If the argument comments are missing for configured argument kinds, add
+    // them.
+    const CommentKind Kind = shouldAddComment(Args[I]);
+    if (Comments.empty() && Kind != CommentKind::None) {
       SmallString<32> ArgComment;
-      (llvm::Twine("/*") + II->getName() + "=*/").toStringRef(ArgComment);
+      llvm::Twine("/*")
+          .concat(II->getName())
+          .concat("=*/")
+          .toStringRef(ArgComment);
----------------
vbvictor wrote:

Why we needed to change this line? It seemed perfectly fine in the first place.
There were other occurances.
Can we rollback Twine changes?

https://github.com/llvm/llvm-project/pull/180408


More information about the cfe-commits mailing list