[PATCH] D154290: [Clang] Implement P2741R3 - user-generated static_assert messages

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 10:36:19 PDT 2023


cor3ntin added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:16408
+                                        Char) ||
+        !Char.isInt())
+      return false;
----------------
aaron.ballman wrote:
> shafik wrote:
> > Why are we specifically checking `!isInt()` what `Kind` do we expect?
> I think the caller already validates that we have a pointer to the correct kind of string, so I kind of think the `isInt()` check is unnecessary. If it's not, can you show a test case where it kicks in?
I was thinking of indeterminate values but i can't find a way to get into that situation, so i think this is superfluous indeed


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154290



More information about the cfe-commits mailing list