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

I don't think we want to return here, don't we want the rest of the checking? 
e.g.,

`true >> -1` should get both the shift bool warning and the negative shift 
warning?

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