mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 23:28:32 -05:00
Merge topic 'clangcl-fixes'
091afa7342Tests: Teach tests when to treat clang-cl as MSVC006768903cWork around clang-cl breakage on make_unique/std::forwardd625dfcdf9Avoid compiling CMake itself as C++17 with Clang's MSVC ABI Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2573
This commit is contained in:
@@ -2,8 +2,21 @@
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# include <comdef.h>
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
std::unique_ptr<int> u(new int(0));
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// clang-cl has problems instantiating this constructor in C++17 mode
|
||||
// error: indirection requires pointer operand ('const _GUID' invalid)
|
||||
// return *_IID;
|
||||
IUnknownPtr ptr{};
|
||||
IDispatchPtr disp(ptr);
|
||||
#endif
|
||||
|
||||
return *u;
|
||||
}
|
||||
|
||||
@@ -70,8 +70,9 @@ bool cmExportFileGenerator::GenerateImportFile()
|
||||
std::unique_ptr<cmsys::ofstream> foutPtr;
|
||||
if (this->AppendMode) {
|
||||
// Open for append.
|
||||
auto openmodeApp = std::ios::app;
|
||||
foutPtr = cm::make_unique<cmsys::ofstream>(this->MainImportFile.c_str(),
|
||||
std::ios::app);
|
||||
openmodeApp);
|
||||
} else {
|
||||
// Generate atomically and with copy-if-different.
|
||||
std::unique_ptr<cmGeneratedFileStream> ap(
|
||||
|
||||
@@ -50,8 +50,9 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
|
||||
// Use copy-if-different if not appending.
|
||||
std::unique_ptr<cmsys::ofstream> foutPtr;
|
||||
if (this->Append) {
|
||||
const auto openmodeApp = std::ios::app;
|
||||
foutPtr =
|
||||
cm::make_unique<cmsys::ofstream>(this->Filename.c_str(), std::ios::app);
|
||||
cm::make_unique<cmsys::ofstream>(this->Filename.c_str(), openmodeApp);
|
||||
} else {
|
||||
std::unique_ptr<cmGeneratedFileStream> ap(
|
||||
new cmGeneratedFileStream(this->Filename, true));
|
||||
|
||||
Reference in New Issue
Block a user