================
@@ -11246,6 +11246,12 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult 
&LHS, ExprResult &RHS,
   if (S.getLangOpts().OpenCL)
     return;
 
+  if (LHS.get()->IgnoreParenImpCasts()->getType()->isBooleanType()) {
+    S.Diag(Loc, diag::warn_shift_bool)
+        << (Opc == BO_Shr) /*left|right*/ << LHS.get()->getSourceRange();
----------------
a-tarasyuk wrote:

Thanks. I agree that it’s important to discuss the `right shift` behavior 
before moving forward with these changes. If we decide to remove the right 
shift, I’ll update the PR.

https://github.com/llvm/llvm-project/pull/127336
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to