[clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check.
authorEtienne Bergeron <etienneb@google.com>
Mon, 4 Apr 2016 15:46:38 +0000 (15:46 +0000)
committerEtienne Bergeron <etienneb@google.com>
Mon, 4 Apr 2016 15:46:38 +0000 (15:46 +0000)
commit1eec3f01f07c88325f9958b85dee8d33f548af52
tree821a09582cb898b9258a18fdf5b64f4384f6ea1f
parentb3c2764f8966d0b9ef19938f1f3bda72eec83533
[clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check.

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",
  [...]
```

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18695

llvm-svn: 265303
clang-tools-extra/clang-tidy/misc/SuspiciousMissingCommaCheck.cpp
clang-tools-extra/clang-tidy/misc/SuspiciousMissingCommaCheck.h
clang-tools-extra/test/clang-tidy/misc-suspicious-missing-comma.cpp