This is an archive of the discontinued LLVM Phabricator instance.

PotentiallyEvaluatedContext in a ImmediateFunctionContext.
ClosedPublic

Authored by usaxena95 on Aug 25 2022, 7:09 AM.

Details

Summary

Body of consteval should be in an ImmediateFunctionContext instead of ConstantEvaluated.
PotentiallyEvaluated expressions in Immediate functions are in a ImmediateFunctionContext as well.

Fixes https://github.com/llvm/llvm-project/issues/51182
Original divergence: https://godbolt.org/z/vadGT5j6f

Diff Detail

Event Timeline

usaxena95 created this revision.Aug 25 2022, 7:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2022, 7:09 AM
usaxena95 requested review of this revision.Aug 25 2022, 7:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2022, 7:09 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
usaxena95 edited the summary of this revision. (Show Details)Aug 25 2022, 7:12 AM
usaxena95 edited the summary of this revision. (Show Details)Aug 25 2022, 7:19 AM
usaxena95 added a reviewer: ilya-biryukov.
shafik added a subscriber: shafik.Aug 25 2022, 9:58 AM

This looks good to me but I want another set of eyes on this.

clang/test/SemaCXX/cxx2a-consteval.cpp
942

Please add a newline

Yes, this looks good to me too. Thanks for working on this.
Can you modify ReleaseNotes.rst to mention the fixed issue?

clang/include/clang/Sema/Sema.h
1355
clang/lib/Sema/SemaDecl.cpp
14803
aaron.ballman added reviewers: cor3ntin, aaron.ballman, Restricted Project.Aug 25 2022, 10:34 AM
aaron.ballman added a subscriber: aaron.ballman.

Adding a few more reviewers just in case, but this is generally looking good. Please also add a release note for the fix!

clang/include/clang/Sema/Sema.h
1355
1357–1359
clang/lib/Sema/SemaDecl.cpp
14803
usaxena95 marked 6 inline comments as done.

Thanks for the quick review.
Addressed comments.

Added release notes.

This revision is now accepted and ready to land.Aug 25 2022, 11:37 AM
This revision was landed with ongoing or failed builds.Aug 26 2022, 1:30 AM
This revision was automatically updated to reflect the committed changes.