[all-commits] [llvm/llvm-project] 76f5c5: [ADT][Support] Fix C4146 error from MSVC

Vladislav Vinogradov via All-commits all-commits at lists.llvm.org
Fri Jan 15 14:34:36 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76f5c5a7b059929f0e0352ad4ff5ec1b78511868
      https://github.com/llvm/llvm-project/commit/76f5c5a7b059929f0e0352ad4ff5ec1b78511868
  Author: Vladislav Vinogradov <vlad.vinogradov47 at gmail.com>
  Date:   2021-01-15 (Fri, 15 Jan 2021)

  Changed paths:
    M llvm/include/llvm/ADT/StringExtras.h
    M llvm/include/llvm/Support/MathExtras.h

  Log Message:
  -----------
  [ADT][Support] Fix C4146 error from MSVC

Unary minus operator applied to unsigned type, result still unsigned.

Use `~0U` instead of `-1U` and `1 + ~VAL` instead of `-VAL`.

Reviewed By: dblaikie

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




More information about the All-commits mailing list