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

For old gcc versions BOOST_MP11_HAS_TEMPLATE_AUTO isn't set #90

Open
rolandschulz opened this issue Jan 7, 2024 · 3 comments
Open

For old gcc versions BOOST_MP11_HAS_TEMPLATE_AUTO isn't set #90

rolandschulz opened this issue Jan 7, 2024 · 3 comments

Comments

@rolandschulz
Copy link

rolandschulz commented Jan 7, 2024

Old versions of gcc (7.1-8.2) don't define __cpp_nontype_template_parameter_auto but only __cpp_template_auto. Because of that BOOST_MP11_HAS_TEMPLATE_AUTO doesn't get set even though those versions support it. spirit checks both (https://github.com/boostorg/spirit/blob/59515f0e56aebdf958eadab30be99cac8872e723/include/boost/spirit/home/x3.hpp#L19). Would this make sense for mp11 too?

@pdimov
Copy link
Member

pdimov commented Jan 7, 2024

Could be worth a try; looks like __cpp_template_auto is set for Clang down to 4.0, I wonder whether such an old compiler would be able to actually compile the things.

@pdimov
Copy link
Member

pdimov commented Jan 7, 2024

Looks like GCC 7 has a pre-standard implementation of auto in template parameters - it retains the value, but not the type, which leads to odd things like 0L being treated as false. (Interestingly, this seems to be the case for MSVC 14.1 as well.)

So this leaves 8.1 and 8.2, and I wonder whether it's worth the bother, as I see 8.4 on ubuntu-20.04.

@Lastique
Copy link
Member

There is now BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS in Boost.Config that indicates support for this feature. It includes older compilers.

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

3 participants