Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][VarDecl] Reset un-evaluated constant for all C++ modes #65818

Merged
merged 1 commit into from
Sep 11, 2023

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
1 of 2 checks passed
@nickdesaulniers nickdesaulniers deleted the bug_65784 branch September 11, 2023 15:38
ahatanaka pushed a commit to apple/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 apple/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
3 participants