[all-commits] [llvm/llvm-project] 61a456: [Clang] prevent assertion failure in value-depende...

Oleksandr T. via All-commits all-commits at lists.llvm.org
Thu Oct 24 01:35:20 PDT 2024


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

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/SemaCXX/constant-expression-cxx11.cpp

  Log Message:
  -----------
  [Clang] prevent assertion failure in value-dependent initializer expressions (#112612)

Fixes #112140

--- 

```
CXXConstructExpr 0x14209e580 'const S':'const struct S' contains-errors 'void (const int &)' list
`-CXXDefaultArgExpr 0x14209e500 'const int' contains-errors
  `-RecoveryExpr 0x14209daf0 'const int' contains-errors
```

This change resolves an issue with evaluating `ArrayFiller` initializers
in _dependent_ contexts, especially when they involve a `RecoveryExpr`.
In certain cases, `ArrayFiller` initializers containing a `RecoveryExpr`
from earlier errors are incorrectly passed to `EvaluateInPlace`, causing
evaluation failures when they are value-dependent.

When this is the case, the initializer is processed through
`EvaluateDependentExpr`, which prevents unnecessary evaluation attempts
and ensures proper handling of value-dependent initializers in
`ArrayFillers`.



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