Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a compiler error on VS2017 #1040

Merged
merged 3 commits into from
Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ if(NOT MSVC OR MSVC_VERSION LESS 1900)
)
endif()

# Enable conformance mode for newer versions of MSVC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/d1parsePackExpressions- does not enable conformance mode (under Project Settings -> C/C++ -> Language). It only affects the new code for fold expressions.

We should either update the comment or the option. It might make sense to use /permissive- if we can. We'd like to switch platform over to conformance mode soon and autowiring could be a good first step.

if(MSVC_VERSION GREATER 1910)
string(APPEND CMAKE_CXX_FLAGS " /permissive-")
endif()

add_definitions(-DGTEST_HAS_TR1_TUPLE=0)

# Recurse through source directories
Expand Down
10 changes: 7 additions & 3 deletions src/autowiring/C++11/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
#pragma once

//C++17 Filesystem standard
#if defined(_MSC_VER) && _MSC_VER >= 1900 //weirdly, only MSVC 2015 supports this so far.
#include <filesystem>
namespace awfsnamespace = std::tr2::sys;
#if defined(_MSC_VER) && _MSC_VER >= 1900
#include <filesystem>
#if _MSC_VER >= 1910
namespace awfsnamespace = std::experimental::filesystem;
#else
namespace awfsnamespace = std::tr2::sys;
#endif
#else
// Experimental filesystem TS library is rare everywhere else, we have to resort to autoboost
#include <autoboost/filesystem.hpp>
Expand Down