Opened 7 years ago
Closed 5 years ago
#11606 closed Bugs (fixed)
Compile errors with Clang 3.7 (and earlier)
Reported by: | Owned by: | Joel de Guzman | |
---|---|---|---|
Milestone: | Boost 1.60.0 | Component: | fusion |
Version: | Boost 1.59.0 | Severity: | Problem |
Keywords: | Cc: |
Description
The problem is complicated and most probably belongs to Boost.Fusion. However I'm not very sure, and technically all tests from fusion compile, it's the test from spirit repository fails. So, I'm posting it under the spirit component.
The spirit/repository/test/qi/keywords.cpp does not compile with recent clang@apple with default preprocessor definitions. I'm attaching the compiler log with this ticket.
The only way I can compile it is to use BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK preprocessor flag, unfortunately with flags triggers another branch of compile errors related to fusion's result_of helper. To fix BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK compile errors the file boost/fusion/support/detail/result_of.hpp should be modified as follows:
Was:
#if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
Should:
#if 1 || (!defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) \ && !defined(BOOST_RESULT_OF_USE_DECLTYPE)) \ || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
Attachments (2)
Change History (12)
by , 7 years ago
Attachment: | compile-log.txt added |
---|
comment:1 by , 7 years ago
Sorry, was wrong correction line. The right one is:
#if (!defined(BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) \ && !defined(BOOST_RESULT_OF_USE_DECLTYPE)) \ || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
comment:2 by , 7 years ago
Component: | spirit → fusion |
---|
Can I get a minimal reproducible code (or your keywords.cpp)?
BTW, I'm planning to remove fusion's result_of hacks and becoming SFINAE-friendly. It should fix the issue.
comment:3 by , 7 years ago
Thank you for the fast reply.
keywords.cpp was the one of the standard tests in spirit repository. Here is the direct link to github for this file: https://github.com/boostorg/spirit/blob/master/repository/test/qi/keywords.cpp
I've read previously about the plans for fusion's "sfinae-fiction" but I also read this will require to reimplement a lot of code in it. So it may be a very time consuming task, as far as I understand.
By now I had to fork fusion into my code, fix result_of.hpp inside and use BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK. I would appreciate any solution that will not require the fusion fork with my custom fixes inside.
follow-up: 6 comment:4 by , 7 years ago
Milestone: | To Be Determined → Boost 1.60.0 |
---|
OK, I overhauled fusion::fold and it should work with decltype based result_of.
Also, I tested qi/keyworkds.cpp (with BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) and compiled it successfully.
follow-up: 8 comment:5 by , 7 years ago
I am able to compile keywords.cpp with your fixes and with BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK, thank you very match.
However, I was not able to compile it with BOOST_RESULT_OF_USE_DECLTYPE. What it the reason?
follow-up: 7 comment:6 by , 7 years ago
Replying to Kohei Takahashi <flast@…>:
OK, I overhauled fusion::fold and it should work with decltype based result_of. Also, I tested qi/keyworkds.cpp (with BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) and compiled it successfully. see: https://github.com/boostorg/fusion/pull/102
Could you please regenerate preprocessed files? There are some orphaned references to fusion::detail::result_of_with_decltype here https://github.com/Flast/fusion/blob/d3449ab5e58d68c2a54d588f3bded4c1dcb2d16e/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp and in other files as well.
comment:7 by , 7 years ago
Replying to Nikki Chumakov <nikkikom@…>:
Replying to Kohei Takahashi <flast@…>:
OK, I overhauled fusion::fold and it should work with decltype based result_of. Also, I tested qi/keyworkds.cpp (with BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK) and compiled it successfully. see: https://github.com/boostorg/fusion/pull/102
Could you please regenerate preprocessed files? There are some orphaned references to fusion::detail::result_of_with_decltype here https://github.com/Flast/fusion/blob/d3449ab5e58d68c2a54d588f3bded4c1dcb2d16e/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp and in other files as well.
Preprocessed files make often pull-request a huge change and to be hard to review it. I'll open a additional PR which only contains preprocessed files after it is merged.
comment:8 by , 7 years ago
Replying to Nikki Chumakov <nikkikom@…>:
However, I was not able to compile it with BOOST_RESULT_OF_USE_DECLTYPE. What it the reason?
I'm not sure is the keywords.hpp aware SFINAE-friendly result_of?
comment:10 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Compile log