This is an archive of the discontinued LLVM Phabricator instance.

[dllexport] odr-use constexpr default args for constructor closures
ClosedPublic

Authored by hans on Apr 8 2022, 9:53 AM.

Details

Summary

InstantiateDefaultCtorDefaultArgs() is supposed to mark default constructor args as odr-used, since those args will be used when emitting the constructor closure.

However, constexpr vars were not getting odr-used since DoMarkVarDeclReferenced() defers them in MaybeODRUseExprs, and the code was calling CleanupVarDeclMarking() which discarded those uses instead of processing them.

(This came up in Chromium, crbug.com/1312086)

Diff Detail

Event Timeline

hans created this revision.Apr 8 2022, 9:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2022, 9:53 AM
hans requested review of this revision.Apr 8 2022, 9:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2022, 9:53 AM
thakis accepted this revision.Apr 8 2022, 10:37 AM

LGTM

This revision is now accepted and ready to land.Apr 8 2022, 10:37 AM

Please wait for some proper clang reviewer

@rsmith @aaron.ballman @rjmccall

What makes me an improper clang reviewer?

No, I mean just second look.

I believe @erichkeane is working in this area as well.

hans added a comment.Apr 11 2022, 7:24 AM

I think @thakis's review is sufficient. I am of course happy to follow up on any extra review with follow-up patches.

This revision was landed with ongoing or failed builds.Apr 11 2022, 7:25 AM
This revision was automatically updated to reflect the committed changes.
rnk added a comment.Apr 14 2022, 12:32 PM

Looks good to me after the fact.