[clang] [clang][bytecode] Fix shifts with an allocated RHS (PR #145280)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 22 23:35:27 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- clang/lib/AST/ByteCode/IntegralAP.h clang/lib/AST/ByteCode/Interp.h clang/test/AST/ByteCode/intap.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/AST/ByteCode/Interp.h b/clang/lib/AST/ByteCode/Interp.h
index cb6eb1e76..1b81ea4de 100644
--- a/clang/lib/AST/ByteCode/Interp.h
+++ b/clang/lib/AST/ByteCode/Interp.h
@@ -2808,9 +2808,10 @@ inline bool DoShiftAP(InterpState &S, CodePtr OpPC, const APSInt &LHS,
S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS; //.toAPSInt();
if (!S.noteUndefinedBehavior())
return false;
- return DoShiftAP<LT, RT,
- Dir == ShiftDir::Left ? ShiftDir::Right : ShiftDir::Left>(
- S, OpPC, LHS, -RHS, Result);
+ return DoShiftAP < LT, RT,
+ Dir == ShiftDir::Left
+ ? ShiftDir::Right
+ : ShiftDir::Left > (S, OpPC, LHS, -RHS, Result);
}
if (!CheckShift<Dir>(S, OpPC, static_cast<LT>(LHS), static_cast<RT>(RHS),
``````````
</details>
https://github.com/llvm/llvm-project/pull/145280
More information about the cfe-commits
mailing list