This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Handle missing local initializers better
ClosedPublic

Authored by tbaeder on Aug 29 2022, 1:26 AM.

Details

Summary

This is illegal in a constexpr context. We can already figure that out,
but we'd still run into an assertion later on when trying to visit the
missing initializer or run the invalid function.

Diff Detail

Event Timeline

tbaeder created this revision.Aug 29 2022, 1:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2022, 1:26 AM
tbaeder requested review of this revision.Aug 29 2022, 1:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2022, 1:26 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
tbaeder updated this revision to Diff 456281.Aug 29 2022, 1:28 AM
erichkeane added inline comments.Aug 29 2022, 6:36 AM
clang/lib/AST/Interp/ByteCodeStmtGen.cpp
245

Would be nice to test this before the work to allocate Offset?

clang/lib/AST/Interp/Function.h
163
tbaeder added inline comments.Aug 29 2022, 6:44 AM
clang/lib/AST/Interp/ByteCodeStmtGen.cpp
245

Ah, sure. Good catch.

tbaeder updated this revision to Diff 456328.Aug 29 2022, 6:49 AM
tbaeder marked 2 inline comments as done.
erichkeane accepted this revision.Aug 29 2022, 6:50 AM
This revision is now accepted and ready to land.Aug 29 2022, 6:50 AM
shafik accepted this revision.Aug 29 2022, 8:51 AM

LGTM

This revision was landed with ongoing or failed builds.Sep 7 2022, 10:32 PM
This revision was automatically updated to reflect the committed changes.