diff options
author | Brad King <brad.king@kitware.com> | 2022-10-20 23:03:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-10-20 23:03:52 (GMT) |
commit | 47063db58d16b73024a1a55f2f63bb85a8125733 (patch) | |
tree | 29ab76fde26ae3dc48980f5b733e5e0cd0716776 /Utilities | |
parent | 81ebea445db3699badb4bb5081c7a2bd436145f9 (diff) | |
parent | ee9805ccd17670e945e41e62f160bfdd9ad8a386 (diff) | |
download | CMake-47063db58d16b73024a1a55f2f63bb85a8125733.zip CMake-47063db58d16b73024a1a55f2f63bb85a8125733.tar.gz CMake-47063db58d16b73024a1a55f2f63bb85a8125733.tar.bz2 |
Merge branch 'filesystem-path-c++03-abi' into release-3.24
Merge-request: !7813
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/std/cm/filesystem | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Utilities/std/cm/filesystem b/Utilities/std/cm/filesystem index ce52fbf..b1cb366 100644 --- a/Utilities/std/cm/filesystem +++ b/Utilities/std/cm/filesystem @@ -809,13 +809,11 @@ public: path& remove_filename() { -# if defined(__CYGWIN__) - // FIXME: Avoid crash due to CYGWIN/MSYS bug(?). See CMake Issue 22090. - static_cast<void>(this->path_.data()); -# endif auto fname = this->get_filename(); if (!fname.empty()) { - this->path_.erase(fname.data() - this->path_.data()); + this->path_.erase(fname.data() - + // Avoid C++17 non-const .data() that may reallocate. + static_cast<path_type const&>(this->path_).data()); } return *this; } @@ -829,13 +827,11 @@ public: path& replace_extension(const path& replacement = path()) { -# if defined(__CYGWIN__) - // FIXME: Avoid crash due to CYGWIN/MSYS bug(?). See CMake Issue 22090. - static_cast<void>(this->path_.data()); -# endif auto ext = this->get_filename_fragment(filename_fragment::extension); if (!ext.empty()) { - this->path_.erase(ext.data() - this->path_.data()); + this->path_.erase(ext.data() - + // Avoid C++17 non-const .data() that may reallocate. + static_cast<path_type const&>(this->path_).data()); } if (!replacement.path_.empty()) { if (replacement.path_[0] != '.') { |