[analyzer] CStringChecker: Remember to highlight the argument expression range.
authorArtem Dergachev <artem.dergachev@gmail.com>
Mon, 30 Jul 2018 23:44:37 +0000 (23:44 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Mon, 30 Jul 2018 23:44:37 +0000 (23:44 +0000)
commit67fdf81f0c98d7389057a6030124b59f95280125
treec610635e45dc9ed52e2abdd8ae6492f28417017c
parent934864bfa79f23b2a230f0847b0649899aa82d2a
[analyzer] CStringChecker: Remember to highlight the argument expression range.

When emitting a bug report, it is important to highlight which argument of the
call-expression is causing the problem.

Before:
warning: Null pointer argument in call to string comparison function
  strcmp(a, b);
  ^~~~~~~~~~~~

After:
warning: Null pointer argument in call to string comparison function
  strcmp(a, b);
  ^      ~

Affects other output modes as well, not just text.

Differential Revision: https://reviews.llvm.org/D50028

llvm-svn: 338333
clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
clang/test/Analysis/cstring-ranges.c [new file with mode: 0644]