[all-commits] [llvm/llvm-project] a56841: [clang-tidy] Update bugprone-stringview-nullptr to...

CJ Johnson via All-commits all-commits at lists.llvm.org
Thu Jan 20 15:08:53 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a5684114445a72b5c0bb5b7b68a5c6eb3486b66d
      https://github.com/llvm/llvm-project/commit/a5684114445a72b5c0bb5b7b68a5c6eb3486b66d
  Author: CJ Johnson <johnsoncj at google.com>
  Date:   2022-01-20 (Thu, 20 Jan 2022)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp
    M clang-tools-extra/docs/clang-tidy/checks/bugprone-stringview-nullptr.rst
    M clang-tools-extra/test/clang-tidy/checkers/bugprone-stringview-nullptr.cpp

  Log Message:
  -----------
  [clang-tidy] Update bugprone-stringview-nullptr to consistently prefer the empty string when passing arguments to constructors/functions

Previously, function(nullptr) would have been fixed with function({}). This unfortunately can change overload resolution and even become ambiguous. T(nullptr) was already being fixed with T(""), so this change just brings function calls in line with that.

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




More information about the All-commits mailing list