This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Call invalid destructors
ClosedPublic

Authored by tbaeder on May 6 2023, 7:42 AM.

Details

Summary
We need to call them like any other function, so we can generate proper
diagnostics.

Diff Detail

Event Timeline

tbaeder created this revision.May 6 2023, 7:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2023, 7:42 AM
tbaeder requested review of this revision.May 6 2023, 7:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2023, 7:42 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
erichkeane added inline comments.May 8 2023, 6:22 AM
clang/test/AST/Interp/records.cpp
582

Which DTOR is happening here that changes behavior in this patch? You removed the isConstexpr test, but it seems to me that the S destructor is constexpr, right?

tbaeder added inline comments.May 8 2023, 6:31 AM
clang/test/AST/Interp/records.cpp
582

Function::isConstexpr() doesn't return the same as FunctionDecl::isConstexpr() - it's just return IsValid right now, so if the compilation of the function aborts at any point, Function::isConstexpr() returns false (even if the function that was compiled is constexpr).

This revision is now accepted and ready to land.May 17 2023, 4:51 AM
This revision was landed with ongoing or failed builds.Jul 25 2023, 10:31 PM
This revision was automatically updated to reflect the committed changes.