diff options
author | cor3ntin <corentinjabot@gmail.com> | 2023-10-05 11:36:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-05 11:36:27 +0200 |
commit | c72d3a0966afd2dcb4421dde922c0faf06d65c0e (patch) | |
tree | c0b2a3b1679d22d9ab598bfc32c16db8b1a5c38a /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | c64a098ee43b0c16aad7d411a89633859d6f10d8 (diff) | |
download | llvm-c72d3a0966afd2dcb4421dde922c0faf06d65c0e.zip llvm-c72d3a0966afd2dcb4421dde922c0faf06d65c0e.tar.gz llvm-c72d3a0966afd2dcb4421dde922c0faf06d65c0e.tar.bz2 |
[Clang] Handle consteval expression in array bounds expressions (#66222)
The bounds of a c++ array is a _constant-expression_. And in C++ it is
also a constant expression.
But we also support VLAs, ie arrays with non-constant bounds.
We need to take care to handle the case of a consteval function (which
are specified to be only immediately called in non-constant contexts)
that appear in arrays bounds.
This introduces `Sema::isAlwayConstantEvaluatedContext`, and a flag in
ExpressionEvaluationContextRecord, such that immediate functions in
array bounds are always immediately invoked.
Sema had both `isConstantEvaluatedContext` and
`isConstantEvaluated`, so I took the opportunity to cleanup that.
The change in `TimeProfilerTest.cpp` is an unfortunate manifestation of
the problem that #66203 seeks to address.
Fixes #65520
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions