diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-10-25 19:33:14 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-10-25 19:33:14 +0000 |
commit | a624409cb54230d304a2c6e19209176166b49085 (patch) | |
tree | 97006a38b87a5356dda21d18250ba392b16ed4a4 /libcxx/src/stdexcept.cpp | |
parent | 601f4cb9f7e2aae28f01448fed3fd7595447c861 (diff) | |
download | llvm-a624409cb54230d304a2c6e19209176166b49085.zip llvm-a624409cb54230d304a2c6e19209176166b49085.tar.gz llvm-a624409cb54230d304a2c6e19209176166b49085.tar.bz2 |
[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
Diffstat (limited to 'libcxx/src/stdexcept.cpp')
-rw-r--r-- | libcxx/src/stdexcept.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libcxx/src/stdexcept.cpp b/libcxx/src/stdexcept.cpp index 0a08bfe..90d8a34 100644 --- a/libcxx/src/stdexcept.cpp +++ b/libcxx/src/stdexcept.cpp @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "__refstring" #include "stdexcept" #include "new" #include "string" #include "system_error" +#include "__refstring" /* For _LIBCPPABI_VERSION */ #if defined(LIBCXX_BUILDING_LIBCXXABI) || defined(__APPLE__) || defined(LIBCXXRT) @@ -20,6 +20,7 @@ static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), ""); + namespace std // purposefully not using versioning namespace { |