chaitanyav added a comment.

output for testcases mentioned in 
https://github.com/llvm/llvm-project/issues/61943

  test.cpp:6:30: warning: overloaded operator << has higher precedence than 
comparison operator [-Woverloaded-shift-op-parentheses]
      std::cout << "Test" << a == 5 ? 1 : 0;
      ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~
  test.cpp:6:25: note: place parentheses around the '<<' expression to silence 
this warning
      std::cout << "Test" << a == 5 ? 1 : 0;
                          ^
      (                       )
  test.cpp:6:30: note: place parentheses around comparison expression to 
evaluate it first
      std::cout << "Test" << a == 5 ? 1 : 0;
                               ^
                             (     )
  test.cpp:6:30: error: invalid operands to binary expression ('ostream' and 
'int')
      std::cout << "Test" << a == 5 ? 1 : 0;
      ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~
  test.cpp:7:30: warning: operator '?:' has lower precedence than '<<'; '<<' 
will be evaluated first [-Wparentheses]
      std::cout << "Test" << a ? 1 : 0;
      ~~~~~~~~~~~~~~~~~~~~~~~~ ^
  test.cpp:7:30: note: place parentheses around the '<<' expression to silence 
this warning
      std::cout << "Test" << a ? 1 : 0;
                               ^
      (                       )
  test.cpp:7:30: note: place parentheses around the '?:' expression to evaluate 
it first
      std::cout << "Test" << a ? 1 : 0;
                               ^
                             (        )
  test.cpp:8:49: warning: operator '?:' has lower precedence than '<<'; '<<' 
will be evaluated first [-Wparentheses]
      std::cout << "Test" << static_cast<bool>(a) ? 1 : 0;
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
  test.cpp:8:49: note: place parentheses around the '<<' expression to silence 
this warning
      std::cout << "Test" << static_cast<bool>(a) ? 1 : 0;
                                                  ^
      (                                          )
  test.cpp:8:49: note: place parentheses around the '?:' expression to evaluate 
it first
      std::cout << "Test" << static_cast<bool>(a) ? 1 : 0;
                                                  ^

@aaron.ballman Please review


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147844

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to