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

Unable to compile a project using recursive variant under MSVC 2017 15.5 with compiler switch /std:c++17 and /std:c++latest #42

Closed
jhruby opened this issue Dec 8, 2017 · 6 comments

Comments

@jhruby
Copy link

jhruby commented Dec 8, 2017

15.4 compiler compiles with all flags std flags without any issues. 15.5 version is unable to compile correctly /std:c++17 and /std:c++latest.

Check out the library:
https://github.com/no1msd/mstch

Configure CMAKE and CMAKE_CXX_FLAGS += /std:c++17

After opening project under visual studio compilation fails:
compiler-output.txt

Please note that switches /std:c++11 and /std:c++14 are working correctly.

Thanks

@egorpugin
Copy link

Same for me.

@egorpugin
Copy link

Simple repro:

#include <boost/variant.hpp>

#include <memory>

int main()
{
    using node = boost::make_recursive_variant<
        int,
        std::shared_ptr<boost::recursive_variant_>
    >::type;

    node x = 1;
}

(Almost) original case from mstch.


#include <boost/variant.hpp>

#include <map>
#include <memory>
#include <vector>

int main()
{
    using node = boost::make_recursive_variant<
        std::nullptr_t, std::string, int, double, bool,
        std::shared_ptr<boost::recursive_variant_>,
        std::map<const std::string, boost::recursive_variant_>,
        std::vector<boost::recursive_variant_>>::type;

    node x = 1;
}

Both works on VS15.5 in C++14 mode, does not work in C++17 mode.

@egorpugin
Copy link

This works for me as a workaround.

#define BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES
#include <mstch/mstch.hpp>

@jhruby
Copy link
Author

jhruby commented Feb 9, 2018

Thanks for workaround this could let me to upgrade visual studio :)

@Kojoley
Copy link
Contributor

Kojoley commented Feb 17, 2018

Other workaround #define BOOST_VARIANT_DETAIL_NO_SUBSTITUTE

apolukhin added a commit that referenced this issue Feb 20, 2018
@apolukhin
Copy link
Member

Many thanks for providing tests and fixes!
Merged to develop, will be merged to master branch after the regression tests cycle.

apolukhin added a commit that referenced this issue Feb 21, 2018
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

4 participants