This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Fix modules build - Rework __refstring definition
ClosedPublic

Authored by EricWF on Oct 14 2016, 3:03 AM.

Details

Summary

__libcpp_refstring currently has two different definitions. First there is the complete definition in <__refstring> but there is also a second in <stdexcept>. The historical reason for this split is because both libc++ and libc++abi need to see the inline definitions of __libcpp_refstrings methods, but the <stdexcept> header doesn't. However this is an ODR violation and breaks the modules build.

This patch fixes the issue by creating a single class definition in <stdexcept> and changing <__refstring> to contain only the inline method definitions. This way both libcxx/src/stdexcept.cpp and libcxxabi/src/stdexcept.cpp see the same declaration in <stdexcept> and definitions in <__refstring>

Diff Detail

Event Timeline

EricWF updated this revision to Diff 74639.Oct 14 2016, 3:03 AM
EricWF retitled this revision from to [libc++] Fix modules build - Rework __refstring definition .
EricWF updated this object.
EricWF added a reviewer: mclow.lists.
EricWF added a subscriber: cfe-commits.
EricWF accepted this revision.Oct 25 2016, 12:41 PM
EricWF added a reviewer: EricWF.
This revision is now accepted and ready to land.Oct 25 2016, 12:41 PM
EricWF closed this revision.Oct 25 2016, 12:42 PM