[PATCH] D147844: [clang][Sema]Print diagnostic warning about precedence when integer expression is used without parentheses in an conditional operator expression

NagaChaitanya Vellanki via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 26 17:22:42 PDT 2023


chaitanyav added a comment.

Bootstrapping build failed due to -werror flag (https://buildkite.com/llvm-project/libcxx-ci/builds/30031)

   | /home/libcxx-builder/.buildkite-agent/builds/google-libcxx-builder-4613821dc47f-1/llvm-project/libcxx-ci/libcxx/test/std/containers/unord/unord.multiset/eq.different_hash.pass.cpp:43:18: error: operator '?:' has lower precedence than '&'; '&' will be evaluated first [-Werror,-Wbitwise-conditional-parentheses]
  # |    43 |   return val & 1 ? 1 : 0;
  # |       |          ~~~~~~~ ^
  
  
  # | /home/libcxx-builder/.buildkite-agent/builds/google-libcxx-builder-4613821dc47f-1/llvm-project/libcxx-ci/libcxx/test/std/containers/unord/unord.multiset/eq.different_hash.pass.cpp:64:19: error: operator '?:' has lower precedence than '&'; '&' will be evaluated first [-Werror,-Wbitwise-conditional-parentheses]
  # |    64 |   return *val & 1 ? 1 : 0;
  # |       |          ~~~~~~~~ ^


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147844



More information about the cfe-commits mailing list