[PATCH] D25603: [libc++] Fix modules build - Rework __refstring definition

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 14 03:03:13 PDT 2016


EricWF created this revision.
EricWF added a reviewer: mclow.lists.
EricWF added a subscriber: cfe-commits.

`__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>`


https://reviews.llvm.org/D25603

Files:
  include/__refstring
  include/stdexcept
  src/stdexcept.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25603.74639.patch
Type: text/x-patch
Size: 7440 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161014/d007238e/attachment-0001.bin>


More information about the cfe-commits mailing list