[all-commits] [llvm/llvm-project] 635e6d: [analyzer] Fix FP for cplusplus.placement new #149...

Aethezz via All-commits all-commits at lists.llvm.org
Wed Jul 30 06:14:27 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 635e6d76530328b8412fbf985708dad26e3f8ea5
      https://github.com/llvm/llvm-project/commit/635e6d76530328b8412fbf985708dad26e3f8ea5
  Author: Aethezz <64500703+Aethezz at users.noreply.github.com>
  Date:   2025-07-30 (Wed, 30 Jul 2025)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp
    M clang/test/Analysis/placement-new.cpp

  Log Message:
  -----------
  [analyzer] Fix FP for cplusplus.placement new #149240 (#150161)

Fix false positive where warnings were asserted for placement new even
when no additional space is requested

The PlacementNewChecker incorrectly triggered warnings when the storage
provided matched or exceeded the allocated type size, causing false
positives. Now the warning triggers only when the provided storage is
strictly less than the required size.

Add test cases covering exact size, undersize, and oversize scenarios to
validate the fix.

Fixes #149240



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list