This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check.
ClosedPublic

Authored by etienneb on Apr 1 2016, 6:26 AM.

Details

Summary

This patch is adding detection of common string literal patterns
that should not trigger warnings.

  • Add a limit on the number of concatenated token,
  • Add support for parenthese sequence of tokens,
  • Add detection of valid indentation.

As an example, this code will no longer trigger a warning:

const char* Array[] = {
  "first literal"
    "indented literal"
    "indented literal",
  "second literal",
  [...]

Diff Detail

Event Timeline

etienneb updated this revision to Diff 52362.Apr 1 2016, 6:26 AM
etienneb retitled this revision from to [clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check..
etienneb updated this object.
etienneb added a reviewer: alexfh.
etienneb added a subscriber: cfe-commits.
etienneb updated this revision to Diff 52365.Apr 1 2016, 6:37 AM

Simplification and nits.

alexfh accepted this revision.Apr 1 2016, 7:14 AM
alexfh edited edge metadata.

Looks good!

This revision is now accepted and ready to land.Apr 1 2016, 7:14 AM

thanks alex, I'll give a day or two to people to jump in.
If no other comments, I'll land it.

etienneb closed this revision.Apr 4 2016, 8:51 AM
This revision was automatically updated to reflect the committed changes.