bugprone-argument-comment: SourceLocation valid judgment avoid emitting coredump...
authorliuke <liuke.gehry@bytedance.com>
Wed, 13 Oct 2021 16:29:36 +0000 (12:29 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Wed, 13 Oct 2021 16:31:02 +0000 (12:31 -0400)
commitea72b55b5c7c281cb21bb7bd50e6e039ca63dfe8
tree027d9ee92ae7b1e9080d664eaf2bf842f15a6b7c
parent24c90165742625272b72961405ae00ced356ec74
bugprone-argument-comment: SourceLocation valid judgment avoid emitting coredump in isInSystemHeader

If the Node has an invalid location, it will trigger assert in
isInSystemHeader(...).

void test() {
  __builtin_va_list __args;
  // __builtin_va_list has no defination in any source file and its
  // CXXConstructorDecl has invalid sourcelocation
}
coredump with "Assertion `Loc.isValid() && "Can't get file
characteristic of invalid loc!"' failed." in
getFileCharacteristic(SourceLocation).
clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/bugprone-argument-comment.cpp