[all-commits] [llvm/llvm-project] 90c1f5: [clang][analyzer] Fix empty enum handling in EnumC...

Endre Fülöp via All-commits all-commits at lists.llvm.org
Wed Aug 9 06:12:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 90c1f51c4b3e7a38a5e1b75de75d15757fc861e4
      https://github.com/llvm/llvm-project/commit/90c1f51c4b3e7a38a5e1b75de75d15757fc861e4
  Author: Endre Fülöp <endre.fulop at sigmatechnology.se>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/EnumCastOutOfRangeChecker.cpp
    M clang/test/Analysis/enum-cast-out-of-range.cpp

  Log Message:
  -----------
  [clang][analyzer] Fix empty enum handling in EnumCastOutOfRange checker

The alpha.cplusplus.EnumCastOutOfRange checker previously gave many
false positives because a warning was given if the initializer value
did not appear in the enumerator list.
The strict handling caused std::byte to always give a warning, as it
is implemented as an enum class without any declarators.

Reviewed By: donat.nagy, steakhal

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




More information about the All-commits mailing list