Skip to content

Conversation

@garyfurnish
Copy link
Contributor

@garyfurnish garyfurnish commented Aug 21, 2017

This fixes autoptr detection on VS2017.

@garyfurnish garyfurnish force-pushed the autoptr_fix branch 2 times, most recently from 4b759fe to 1dc41f6 Compare August 21, 2017 05:29
@stefanseefeld
Copy link
Member

Can you elaborate a bit on a) the rationale for this patch and b) the symptoms you are observing ?
I'm not entirely convinced of the patch, at least not without further (inline) comments. The macro discriminates the availability of smart pointers but the conditional code involves std::move. There is no apparent relationship between the two (other than that both are C++11 features)...

@garyfurnish
Copy link
Contributor Author

The rationale is that auto_ptr is permanently removed from MS stl as of VS2017 update 3 per c++ standard, so any auto_ptr use is an unrescuable problem. You can't copy unique pointers so initialization must be done via move. I suspect this subtly breaks other things.

@stefanseefeld
Copy link
Member

And VS2017 doesn't set __cplusplus properly ?

@garyfurnish
Copy link
Contributor Author

No :(

@garyfurnish
Copy link
Contributor Author

Interestingly enough in spite of the failing integration tests on VS this does compile successfully on my machine with VS 2017 Update 3, so maybe its something that needs a work around that was a silently fixed compiler bug.

@garyfurnish
Copy link
Contributor Author

Is it possible to get more versions of VS on appveyor?

@MarcelRaad
Copy link

MarcelRaad commented Aug 21, 2017

@garyfurnish : the problem only occurs when compiling in C++17 mode via /std:c++latest or /std:c++17, if you're talking about the official Boost regression test runners. Half of the regression test runners are using /std:c++latest, and these are failing.

I believe support for std::move is checked via BOOST_NO_CXX11_RVALUE_REFERENCES most of the time, so maybe both could be used? Even though I don't know what C++11 smart pointers without rvalue references would mean, maybe only std::shared_ptr and std::weak_ptr...

@garyfurnish
Copy link
Contributor Author

garyfurnish commented Aug 21, 2017

@MarcelRaad Well, there are really a few issues here.

  1. the scons that runs the tests on appveyor doesn't detect c++11 correctly on windows
  2. if you fix c++latest to use shared_ptr, there is an awful linker error on appveyor. Somewhere between the version of vc++ on appveyor and 2017 update 3, the error mysteriously stopped being an error, so I'm assuming it was some sort of type system bug.
  3. Having fixed both 1 and 2 and running on 2017 update 3, some of the tests on windows are failing because there are other places where c++11 support detection on windows aren't detected correctly. Will fix this after the eclipse.
  4. But fixing the regression errors on appveyor will probably require some sort of dicscrimination on MSVC version. It would be nice if I knew the exact version where it started working, but I don't have an array of VS machines setup. I'm thinking defining a BOOST_PYTHON_MSVC_WORKAROUND that when true defaults things to autoptr so as to not break existing code.

But I think I know how to fix all of the current bugs on std:c++ latest. I only have 3 tests not passing right now, and they seem straightforward detection errors. Its just going to take some creativity to figure out how to deal with that VC bug.

@garyfurnish garyfurnish force-pushed the autoptr_fix branch 3 times, most recently from 4eaddee to bb08c3d Compare August 21, 2017 19:44
@garyfurnish garyfurnish reopened this Aug 21, 2017
@garyfurnish garyfurnish force-pushed the autoptr_fix branch 2 times, most recently from 9df1dee to b1ccb5f Compare August 21, 2017 20:35
@garyfurnish
Copy link
Contributor Author

This appears to work correctly and pass tests on MSVC 2017 update 3 on a real machine with scons beta 3. I believe the appveyor errors are spurious and were there pre-modifications, so this should be almost good to go.
There are errors on import. This be a preexisting bug, so I think this is good to go!
For whatever reason travis is hung up on running this, so I did test it on a linux box and it works fine just in case the somewhat obvious changes didn't work right.
Does this need anything else to pass inspection?

# if defined(__ICL) && __ICL < 600
typedef boost::shared_ptr<T> smart_pointer;
# elif __cplusplus < 201103L
# elif BOOST_NO_CXX11_SMART_PTR
Copy link
Member

Choose a reason for hiding this comment

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

#elif defined(BOOST_NO_CXX11_SMART_PTR)

@garyfurnish
Copy link
Contributor Author

Bump.

@stefanseefeld stefanseefeld merged commit 30c9eb1 into boostorg:develop Oct 25, 2017
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

Successfully merging this pull request may close these issues.

4 participants