[all-commits] [llvm/llvm-project] 05b6c2: [Clang] fix range calculation for conditionals wit...

Oleksandr T. via All-commits all-commits at lists.llvm.org
Tue Oct 29 02:44:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 05b6c2e4b933e7a3606899c72067c92b6077287b
      https://github.com/llvm/llvm-project/commit/05b6c2e4b933e7a3606899c72067c92b6077287b
  Author: Oleksandr T. <oleksandr.tarasiuk at outlook.com>
  Date:   2024-10-29 (Tue, 29 Oct 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/SemaCXX/conditional-expr.cpp

  Log Message:
  -----------
  [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)



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