[PATCH] D18457: [clang-tidy] Add a new checker to detect missing comma in initializer list.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 30 09:19:37 PDT 2016


alexfh added inline comments.

================
Comment at: clang-tidy/misc/SuspiciousMissingCommaCheck.cpp:75
@@ +74,3 @@
+  diag(ConcatenatedLiteral->getLocStart(),
+       "suspicious string literal, probably missing a comma");
+}
----------------
xazax.hun wrote:
> alexfh wrote:
> > We need to add a recommendation on how to silence this warning (use parentheses, for example). Fine for a follow up.
> A possible way to silence this warning would be to implement a heuristic that is available in szdominik's implementation, i.e.: when the size of the array is explicitly given by the user and it matches the length of the initializer list do not warn.
The check shouldn't complain in this case, but I wouldn't recommend this as a fix, since it makes the code more strict in an inconvenient way.


http://reviews.llvm.org/D18457





More information about the cfe-commits mailing list