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

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 30 09:07:47 PDT 2016


xazax.hun added inline comments.

================
Comment at: clang-tidy/misc/SuspiciousMissingCommaCheck.cpp:75
@@ +74,3 @@
+  diag(ConcatenatedLiteral->getLocStart(),
+       "suspicious string literal, probably missing a comma");
+}
----------------
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.


http://reviews.llvm.org/D18457





More information about the cfe-commits mailing list