This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Use always_inline for std::stringbuf::str() on Windows to work around #40363
AbandonedPublic

Authored by hans on Jul 13 2023, 4:37 AM.

Details

Reviewers
pfusik
ldionne
Group Reviewers
Restricted Project
Summary

As reported in https://github.com/llvm/llvm-project/issues/40363, the exclude_from_explicit_instantiation attribute doesn't currently really work with dllimport.

Because of that, the new stringbuf::str() overload added in D153709 is dllimport on Windows but not actually defined in the cpp file, causing link errors.

As discussed on that code review, this patch works around the problem with the always_inline attribute until Clang can be fixed.

Diff Detail

Event Timeline

hans created this revision.Jul 13 2023, 4:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 4:37 AM
hans requested review of this revision.Jul 13 2023, 4:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 4:37 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

I think https://reviews.llvm.org/D155185 addresses it better: there are two overloads to handle for now, there will be eight.

hans abandoned this revision.Jul 13 2023, 5:15 AM

I think https://reviews.llvm.org/D155185 addresses it better: there are two overloads to handle for now, there will be eight.

That does look better :) Thanks!