Commit Graph

3 Commits

Author SHA1 Message Date
Eric Fiselier a624409cb5 [libc++] Fix modules build - Rework __refstring definition
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>`

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25603

llvm-svn: 285100
2016-10-25 19:33:14 +00:00
Dan Albert 8645ea65e5 Fix some -Wundef issues.
llvm-svn: 228266
2015-02-05 02:34:59 +00:00
Joerg Sonnenberger a1fbf3459f Exceptions store the message as reference counted string for
compatibility to libstdc++. Move the implementation into a header for
easier sharing with libc++abi. Merge a number of improvements from that
version. Provide a POD definition for <stdexcept>'s public use to avoid
cast dances. Discussed with Marshall Clow.

llvm-svn: 207695
2014-04-30 19:54:11 +00:00