[all-commits] [llvm/llvm-project] b6628c: [Clang] Fix crash on invalid size in user-defined ...
Sirraide via All-commits
all-commits at lists.llvm.org
Mon Apr 22 09:41:58 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b6628c24ef017138b8d6eb288e94c141e7c846b0
https://github.com/llvm/llvm-project/commit/b6628c24ef017138b8d6eb288e94c141e7c846b0
Author: Sirraide <aeternalmail at gmail.com>
Date: 2024-04-22 (Mon, 22 Apr 2024)
Changed paths:
M clang/docs/ReleaseNotes.rst
M clang/include/clang/Basic/DiagnosticSemaKinds.td
M clang/lib/AST/ExprConstant.cpp
M clang/test/SemaCXX/static-assert-cxx26.cpp
Log Message:
-----------
[Clang] Fix crash on invalid size in user-defined `static_assert` message (#89420)
This addresses two problems observed in #89407 wrt user-defined
`static_assert` messages:
1. In `Expr::EvaluateCharRangeAsString`, we were calling `getExtValue()`
instead of `getZExtValue()`, which would assert if a negative or very
large number was returned from `size()`.
2. If the value could not be converted to `std::size_t`, attempting to
diagnose that would crash because `ext_cce_narrowing` was missing two
`%select` cases.
This fixes #89407.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list