Opened 8 years ago
Closed 7 years ago
#11211 closed Bugs (fixed)
Fusion example no longer compiles (BOOST_FUSION_DEFINE_STRUCT)
Reported by: | Owned by: | Joel de Guzman | |
---|---|---|---|
Milestone: | Boost 1.59.0 | Component: | fusion |
Version: | Boost 1.58.0 | Severity: | Regression |
Keywords: | fusion | Cc: | flast@… |
Description
From the manual:
#include <string> #include "boost/fusion/adapted/struct/define_struct.hpp" // demo::employee is a Fusion sequence BOOST_FUSION_DEFINE_STRUCT( (demo), employee, (std::string, name) (int, age)) int main() { }
It fails to compile with boost 1.58. With boost 1.57, compiles successfully.
g++ --std=c++11 test.cpp -I /home/saknussemm/downloads/boost_1_58_0
clang fails with a similar error.
Attachments (1)
Change History (15)
by , 8 years ago
comment:1 by , 8 years ago
Severity: | Problem → Regression |
---|---|
Summary: | Fusion example no longer compiles → Fusion example no longer compiles (BOOST_FUSION_DEFINE_STRUCT) |
comment:2 by , 8 years ago
follow-up: 4 comment:3 by , 8 years ago
Cc: | added |
---|---|
Milestone: | To Be Determined → Boost 1.59.0 |
Confirmed.
Ah, I see, it's my bad.
The constructors of BOOST_FUSION_DEFINE_STRUCT (might other variations too) is not a template: the constructors of each elements must be constexpr.
comment:4 by , 8 years ago
Sorry I didn't see you already handled the problem. I made a pull-request on github in between. It is ok for you or you wanted to do something finer ?
comment:5 by , 8 years ago
I just added a test case, not a fix. Is there another PR? Anyway, I merged Damien's.
comment:5 by , 8 years ago
I just added a test case, not a fix. Is there another PR? Anyway, I merged Damien's.
follow-up: 7 comment:6 by , 7 years ago
I added another PR for BOOST_FUSION_DEFINE_INLINE_STRUCT and added some other test cases.
I thought for people who are using the library in version 1.58 right now they can work the issue around with :
g++ -DBOOST_CONSTEXPR=
comment:7 by , 7 years ago
I thought for people who are using the library in version 1.58 right now they can work the issue around with :
g++ -DBOOST_CONSTEXPR=
Unfortunately, this workaround doesn't work.
comment:8 by , 7 years ago
I think we should release some patches to fix this issue, like ttps://github.com/boostorg/website/blob/master/feed/history/boost_1_58_0.qbk#L25-L40 .
candidates
- ttps://github.com/boostorg/fusion/pull/70
- ttps://github.com/boostorg/fusion/pull/71
follow-up: 10 comment:9 by , 7 years ago
Here is another minimal test case that fails to compile (in c++11) but now using BOOST_FUSION_ADAPT_STRUCT. I suspect that it is the same issue.
#include <boost/fusion/adapted/struct.hpp> struct X {}; BOOST_FUSION_ADAPT_STRUCT( X, ) int main() { return 0; }
comment:10 by , 7 years ago
Replying to Dennis Brentjes <d.brentjes@…>:
Here is another minimal test case that fails to compile (in c++11) but now using BOOST_FUSION_ADAPT_STRUCT. I suspect that it is the same issue.
#include <boost/fusion/adapted/struct.hpp> struct X {}; BOOST_FUSION_ADAPT_STRUCT( X, ) int main() { return 0; }
No, it's not a same issue; you can test with -DBOOST_NO_CXX11_CONSTEXPR
flag to disabling BOOST_CONSTEXPR
feature.
In original test case, work with -DBOOST_NO_CXX11_CONSTEXPR
due to avoiding regression: http://melpon.org/wandbox/permlink/APJ0Vi289gSKA7MO .
However, your case dosn't work even defining -DBOOST_NO_CXX11_CONSTEXPR
: http://melpon.org/wandbox/permlink/ktex1HEt5w4bplsv .
follow-up: 12 comment:11 by , 7 years ago
You are right. It seems it's related to adapting an empty struct. Something which was possible in 1.57. Should I create a separate ticket for this issue?
comment:12 by , 7 years ago
Replying to Dennis Brentjes <d.brentjes@…>:
Should I create a separate ticket for this issue?
Yes, please!
Joel, I think this issue is now fixed and can be closed.
comment:13 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
confirmed clang and g++. i added this test case.