etienneb added a comment. this is cool :) It's a simple and precise rule to avoid using the probabilistic heuristic.
================ Comment at: clang-tidy/misc/SuspiciousMissingCommaCheck.cpp:94 @@ -93,3 +93,3 @@ Finder->addMatcher(StringsInitializerList.bind("list"), this); } ---------------- If it's working as-is,... this is neat :) ================ Comment at: clang-tidy/misc/SuspiciousMissingCommaCheck.cpp:106 @@ +105,3 @@ + if (InitializerList->hasArrayFiller()) { + diag(InitializerList->getExprLoc(), + "wrong string array initialization: " ---------------- 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? ================ Comment at: test/clang-tidy/misc-suspicious-missing-comma.cpp:84 @@ +83,3 @@ + +// Missing comma or wrong explicit array size. +const char* TheThreeMusketeers[4] = { ---------------- Could you add the more complicated example I sent you. More tests is always welcome. Currently, there is no tests for initialisation list in initialisation list. http://reviews.llvm.org/D19769 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits