[all-commits] [llvm/llvm-project] ab9dbc: Fix "pointer is null" clang static analyzer warnin...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Jan 14 08:35:33 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ab9dbc1d124cdf288474073f5233e3fd6ee8e9c3
      https://github.com/llvm/llvm-project/commit/ab9dbc1d124cdf288474073f5233e3fd6ee8e9c3
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-01-14 (Tue, 14 Jan 2020)

  Changed paths:
    M clang/lib/Sema/SemaOverload.cpp

  Log Message:
  -----------
  Fix "pointer is null" clang static analyzer warnings. NFCI.

Use cast<>/castAs<> instead of dyn_cast<>/getAs<> since the pointers are always dereferenced and cast<>/castAs<> will perform the null assertion for us.


  Commit: cfd366ba74c566038c6f417da9c9becc321fd737
      https://github.com/llvm/llvm-project/commit/cfd366ba74c566038c6f417da9c9becc321fd737
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-01-14 (Tue, 14 Jan 2020)

  Changed paths:
    M clang/lib/Sema/SemaDeclCXX.cpp

  Log Message:
  -----------
  Fix "pointer is null" static analyzer warnings. NFCI.

Use castAs<> instead of getAs<> since the pointer is dereferenced immediately in all cases and castAs will perform the null assertion for us.


Compare: https://github.com/llvm/llvm-project/compare/e2b8e2113a49...cfd366ba74c5


More information about the All-commits mailing list