This is an archive of the discontinued LLVM Phabricator instance.

[libc++][Modules] Restore the <string> include to <__format/format_functions.h>
ClosedPublic

Authored by iana on Jul 12 2023, 1:55 PM.

Details

Summary

<__format/format_functions.h> was using <string>, we need to bring the include back that was removed in D154122.

Diff Detail

Event Timeline

iana created this revision.Jul 12 2023, 1:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 1:55 PM
Herald added a subscriber: ributzka. · View Herald Transcript
iana requested review of this revision.Jul 12 2023, 1:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 1:55 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript

I think the change is the wrong direction. std::format returns a std::string. In my experience arguments and return values often need to be explicitly exported. So I think the proper fix would be to include string in this header. The main issue is that accidentally forgotten headers worked in the past.

iana added a comment.Jul 14 2023, 10:49 AM

I think the change is the wrong direction. std::format returns a std::string. In my experience arguments and return values often need to be explicitly exported. So I think the proper fix would be to include string in this header. The main issue is that accidentally forgotten headers worked in the past.

But you just barely removed that include in D154122

iana added a comment.Jul 14 2023, 10:52 AM

I think the change is the wrong direction. std::format returns a std::string. In my experience arguments and return values often need to be explicitly exported. So I think the proper fix would be to include string in this header. The main issue is that accidentally forgotten headers worked in the past.

But you just barely removed that include in D154122

Then again, the CI says you're right and the include is needed.

iana updated this revision to Diff 540504.Jul 14 2023, 11:14 AM

Restore the <string> include to <__format/format_functions.h> instead

iana retitled this revision from [libc++][Modules] Remove spurious std.string export from std.format.__format.format_functions to [libc++][Modules] Restore the <string> include to <__format/format_functions.h>.Jul 14 2023, 11:14 AM
iana edited the summary of this revision. (Show Details)
Mordante accepted this revision.Jul 15 2023, 5:53 AM

I think the change is the wrong direction. std::format returns a std::string. In my experience arguments and return values often need to be explicitly exported. So I think the proper fix would be to include string in this header. The main issue is that accidentally forgotten headers worked in the past.

But you just barely removed that include in D154122

That seems like a mistake on my side.

Thanks for the patch, LGTM!

This revision is now accepted and ready to land.Jul 15 2023, 5:53 AM