[PATCH] D19769: [clang-tidy] Add explicitly given array size heuristic to misc-suspicious-missing-comma check.

Dominik Szabó via cfe-commits cfe-commits at lists.llvm.org
Mon May 2 03:16:55 PDT 2016


szdominik marked 3 inline comments as done.

================
Comment at: clang-tidy/misc/SuspiciousMissingCommaCheck.cpp:106
@@ +105,3 @@
+  if (InitializerList->hasArrayFiller()) {
+      diag(InitializerList->getExprLoc(),
+           "wrong string array initialization: "
----------------
etienneb wrote:
> The error should still be reported to the missing comma (concatenated token):
>   ConcatenatedLiteral->getLocStart(),
> 
> We could add a NOTE to point to the array, stating that the size mismatch.
> 
> What do you think?
Interesting question (the first idea was that we can't decide that the comma is missing or the size is wrong, so report to the array, that's a more secure solution), but I agree that the note could be more effective.
And... it's still a suspicious-missing-comma checker, not a wrong-string-array-size checker :)


http://reviews.llvm.org/D19769





More information about the cfe-commits mailing list