Skip to content

Conversation

@nickdesaulniers
Copy link
Member

@nickdesaulniers nickdesaulniers commented Sep 8, 2023

After commit 610ec95 ("[clang] allow const structs/unions/arrays to
be constant expressions for C"), attempts to evaluate
structs/unions/arrays as constants are also performed for C++98 and
C++03.

An assertion was getting tripped up since the potentially-partially
evaluated value was not being reset for those 2 language modes. Make
sure to reset it now for all C++ modes.

Fixes: #65784

After commit 610ec95 ("[clang] allow const structs/unions/arrays to
be constant expressions for C"), attempts to evaluate
structs/unions/arrays as constants are also performed for C++98 and
C++03.

An assertion was getting tripped up since the potentially-partially
evaluated value was not being reset for those 2 language modes.  Make
sure to reset it now for all C++ modes.

Fixes: 65784
@nickdesaulniers nickdesaulniers requested a review from a team as a code owner September 8, 2023 22:38
@github-actions github-actions bot added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Sep 8, 2023
@shafik
Copy link
Collaborator

shafik commented Sep 9, 2023

LGTM, thank you for the quick fix!

@nickdesaulniers nickdesaulniers merged commit 2618154 into llvm:main Sep 11, 2023
@nickdesaulniers nickdesaulniers deleted the bug_65784 branch September 11, 2023 15:38
ahatanaka pushed a commit to swiftlang/llvm-project that referenced this pull request Sep 11, 2023
…65818)

After commit 610ec95 ("[clang] allow const structs/unions/arrays to
be constant expressions for C"), attempts to evaluate
structs/unions/arrays as constants are also performed for C++98 and
C++03.

An assertion was getting tripped up since the potentially-partially
evaluated value was not being reset for those 2 language modes.  Make
sure to reset it now for all C++ modes.

Fixes: llvm#65784
(cherry picked from commit 2618154)
ahatanaka pushed a commit to swiftlang/llvm-project that referenced this pull request Sep 11, 2023
…65818)

After commit 610ec95 ("[clang] allow const structs/unions/arrays to
be constant expressions for C"), attempts to evaluate
structs/unions/arrays as constants are also performed for C++98 and
C++03.

An assertion was getting tripped up since the potentially-partially
evaluated value was not being reset for those 2 language modes.  Make
sure to reset it now for all C++ modes.

Fixes: llvm#65784
(cherry picked from commit 2618154)
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this pull request Sep 19, 2023
…65818)

After commit 610ec95 ("[clang] allow const structs/unions/arrays to
be constant expressions for C"), attempts to evaluate
structs/unions/arrays as constants are also performed for C++98 and
C++03.

An assertion was getting tripped up since the potentially-partially
evaluated value was not being reset for those 2 language modes.  Make
sure to reset it now for all C++ modes.

Fixes: llvm#65784
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assertion failed: ((!Result.isArray() || Result.getArrayInitializedElts() == 0) && "zero-initialized array shouldn't have any initialized elts"

3 participants