[PATCH] D136528: [clang][Interp] Implement add and sub compound assign operators

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 24 07:13:04 PDT 2022


tbaeder added inline comments.


================
Comment at: clang/test/AST/Interp/literals.cpp:426
+  }
+  static_assert(subAll(213) == 0);
+
----------------
aaron.ballman wrote:
> We also need tests for failure situations:
> ```
> constexpr int func() {
>   int i = __INT_MAX__;
>   i += 1; // oops
>   return i;
> }
> 
> constexpr int another() {
>   int i = __INT_MIN__;
>   i -= 1; // oops
>   return i;
> }
> ```
woops, I was sure I added this but it was for the `++`/`--` patch it seems.


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

https://reviews.llvm.org/D136528



More information about the cfe-commits mailing list