summaryrefslogtreecommitdiffstats
path: root/libcxx/include/string
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-11-20 20:23:27 +0000
committerEric Fiselier <eric@efcs.ca>2017-11-20 20:23:27 +0000
commit506a09ba0fd11f0cf302cda3d84b0e1ec3cfee97 (patch)
tree53d17c799ac4f4df013dc9a83f245cf4ee33c4b8 /libcxx/include/string
parent31275d4472830967c406086b0f7ddf5ae08595f6 (diff)
downloadbcm5719-llvm-506a09ba0fd11f0cf302cda3d84b0e1ec3cfee97.tar.gz
bcm5719-llvm-506a09ba0fd11f0cf302cda3d84b0e1ec3cfee97.zip
Fix std::string::data() symbol during library build.
The non-const data() member of std::string is only exposed in C++17 and beyond. However std::string is externally instantiated and so the member function needs to be exposed to be externally instantiated. On Linux and OS X this shouldn't cause a problem, because _LIBCPP_INLINE_VISIBILITY ensures the symbol is always inlined. However on Windows, the symbol gets marked dllimport, but there is no definition to import, causing link errors. llvm-svn: 318690
Diffstat (limited to 'libcxx/include/string')
-rw-r--r--libcxx/include/string2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/include/string b/libcxx/include/string
index 81c242ed6e9..e7142b2b28e 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -1128,7 +1128,7 @@ public:
const value_type* c_str() const _NOEXCEPT {return data();}
_LIBCPP_INLINE_VISIBILITY
const value_type* data() const _NOEXCEPT {return _VSTD::__to_raw_pointer(__get_pointer());}
-#if _LIBCPP_STD_VER > 14
+#if _LIBCPP_STD_VER > 14 || defined(_LIBCPP_BUILDING_LIBRARY)
_LIBCPP_INLINE_VISIBILITY
value_type* data() _NOEXCEPT {return _VSTD::__to_raw_pointer(__get_pointer());}
#endif
OpenPOWER on IntegriCloud