sberg added a comment.

I think this generates a false positive with `test.cc`

  enum E { E1 = 1, E2 = 2 };
  bool f(E e) { return ((e & E1) ? 1 : 0) + ((e & E2) ? 1 : 0) > 1; }

and `clang++ -fsyntax-only -Wtautological-value-range-compare test.cc`

  test.cc:2:62: warning: result of comparison of 1-bit unsigned value > 1 is 
always false [-Wtautological-value-range-compare]
  bool f(E e) { return ((e & E1) ? 1 : 0) + ((e & E2) ? 1 : 0) > 1; }
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85256/new/

https://reviews.llvm.org/D85256

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D85256: A... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Dávid Bolvanský via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Dávid Bolvanský via Phabricator via cfe-commits
    • [PATCH] D852... Richard Trieu via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Stephan Bergmann via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits
    • [PATCH] D852... Richard Smith - zygoloid via Phabricator via cfe-commits

Reply via email to