[all-commits] [llvm/llvm-project] 100720: [libc] Use `if constexpr` for compile-time conditi...

Roland McGrath via All-commits all-commits at lists.llvm.org
Tue Oct 22 22:43:54 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 100720cc4bbd165bb7f447429716c5be680b81f1
      https://github.com/llvm/llvm-project/commit/100720cc4bbd165bb7f447429716c5be680b81f1
  Author: Roland McGrath <mcgrathr at google.com>
  Date:   2024-10-22 (Tue, 22 Oct 2024)

  Changed paths:
    M libc/test/UnitTest/FPMatcher.h

  Log Message:
  -----------
  [libc] Use `if constexpr` for compile-time conditionals (#113417)

Don't use plain `if` for things that are compile-time constants.
Instead, use `if constexpr`.  This both ensures that these are
properly wired up constant expressions as intended, and prevents
warnings from the compiler about useless `if` checks that look in
the source like they're meant to do something at runtime but will
just be compiled away.



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