Skip to content

Commit 05b6c2e

Browse files
authored
[Clang] fix range calculation for conditionals with throw expressions (#112081)
Fixes #111854 --- The issue arises when `GetExprRange` encounters a `ConditionalOperator` with a `CXXThrowExpr` ```md ConditionalOperator 0x1108658e0 'int' |-CXXBoolLiteralExpr 0x110865878 '_Bool' true |-CXXThrowExpr 0x1108658a8 'void' | `-IntegerLiteral 0x110865888 'int' 0 `-IntegerLiteral 0x1108658c0 'int' 0 ``` https://github.com/llvm/llvm-project/blob/ed3d05178274890fb804f43ae1bcdfd33b5fd8f0/clang/lib/Sema/SemaChecking.cpp#L9628-L9631 The current behavior causes the `GetExprRange` to proceed with the throw expression (`CO->getTrueExpr()`/`void` type)
1 parent 8d38fbf commit 05b6c2e

File tree

3 files changed

+140
-86
lines changed

3 files changed

+140
-86
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ Bug Fixes to C++ Support
571571
- Clang incorrectly considered a class with an anonymous union member to not be
572572
const-default-constructible even if a union member has a default member initializer.
573573
(#GH95854).
574-
- Fixed an assertion failure when evaluating an invalid expression in an array initializer (#GH112140)
574+
- Fixed an assertion failure when evaluating an invalid expression in an array initializer. (#GH112140)
575+
- Fixed an assertion failure in range calculations for conditional throw expressions. (#GH111854)
575576

576577
Bug Fixes to AST Handling
577578
^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)