Skip to content

std::negation requires Visual Studio 2015 Update 3 #706

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

Closed
SylvainCorlay opened this issue Mar 1, 2017 · 8 comments
Closed

std::negation requires Visual Studio 2015 Update 3 #706

SylvainCorlay opened this issue Mar 1, 2017 · 8 comments
Assignees

Comments

@SylvainCorlay
Copy link
Member

As reported here.

@wjakob
Copy link
Member

wjakob commented Mar 1, 2017

I think that we generally require that compiler because earlier versions may ICE when compiling pybind11 code.

@SylvainCorlay
Copy link
Member Author

OK, it was just a FYI as I have a build machine that complained about this on the update to Pybind11 2.0.0.

In other places of the code base, you check for the specific msvc version.

@jagerman
Copy link
Member

jagerman commented Mar 1, 2017

We should probably put a cmake fatal error for unsupported compilers. (MSVC before 2015u3, GCC before 4.8, etc.)

@dean0x7d
Copy link
Member

dean0x7d commented Mar 2, 2017

VS 2015 Update 2 should be able to compile pybind11 with just some minor workarounds, but I think the bigger issue is that it's difficult to test. AFAIK AppVeyor only has a "Visual Studio 2015" option and it's always kept up to date, so there's only Update 3 to test against.

We should probably put a cmake fatal error for unsupported compilers. (MSVC before 2015u3, GCC before 4.8, etc.)

Making the compiler support explicit sounds good, but I think CMake skimps on the minor version numbers. Perhaps doing the check in common.h?

@jagerman
Copy link
Member

jagerman commented Mar 3, 2017

Somewhat related: the latest MSVC 2017 RC also ICEs when building pybind as well.

What a wonderful compiler.

Edit: this is caused by the decltype() in the template parameter of the second cpp_function constructor, added in PR #677. I'll just ignore it for now, and add a workaround if the final 2017 release (due in the next week or two, IIRC) still hits it.

@jagerman jagerman added this to the v2.1 milestone Mar 14, 2017
@jagerman jagerman self-assigned this Mar 14, 2017
@jcelerier
Copy link
Contributor

Another problem with std::negation is that it was introduced in C++17 while pybind11 advertises C++11 compat...

@jagerman
Copy link
Member

jagerman commented Mar 15, 2017

It's only used (along with std::conjunction and std::disjunction) on MSVC, because MSVC has it in the stl (as of 2015u3), and has trouble with some of the template metaprogramming in common.h.

Edit: this is the part that doesn't work on MSVC. But if you look at the surrounding code, you can see we have various differences based on whether under a C++14, C++11, or C++17 compiler, plus special MSVC handling to avoid compiler bugs.

@jcelerier
Copy link
Contributor

jcelerier commented Mar 16, 2017

@jagerman when my compiler (clang on macOS ) is in -std=c++1z mode, it seems that it goes through the std::negationcode path which isn't implemented yet in apple's clang.
Would a pull request that would put it behind a feature test macro (__cpp_lib_experimental_logical_traits and __cpp_lib_logical_traits) be accepted ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants