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

vector: Fix for compilers not compatible with CWG defect 945 #166

Merged
merged 1 commit into from Dec 24, 2017

Conversation

Kojoley
Copy link
Contributor

@Kojoley Kojoley commented Dec 23, 2017

Closes #160 (I believe).
Reject the PR if you are not going to add support for compilers that do not support CWG defect 945 (c++11 in clang 3.0, gcc 4.6?). Also, I am not sure this is enough and there are no other problems with them.

@djowel
Copy link
Member

djowel commented Dec 23, 2017

I'm not sure if we should support such compilers. However, this is such an easy workaround that it's probably worth having. I'm on the fence. I'll leave it up to @Flast to decide.

@Flast
Copy link
Collaborator

Flast commented Dec 24, 2017

this is such an easy workaround that it's probably worth having

Yes, it's trivial. I have no reason for rejecting this.

@Flast
Copy link
Collaborator

Flast commented Dec 24, 2017

Ah, it's assigned to me. OK, I'll merge.

@Flast Flast merged commit 806b621 into boostorg:develop Dec 24, 2017
@Flast
Copy link
Collaborator

Flast commented Dec 24, 2017

Thank you, both!

@djowel
Copy link
Member

djowel commented Dec 24, 2017

Thank you, both!

It's always good to know Spirit, Fusion and Phoenix are in very capable hands.

@Kojoley Kojoley deleted the cwg-defect-945 branch December 24, 2017 10:35
Kojoley added a commit to boostorg/spirit that referenced this pull request Dec 25, 2017
@prudhomm
Copy link

@Flast I don't think it is such as simple change. It breaks my c++14 code and reverting back to the previous one fixes it.

@prudhomm
Copy link

@Kojoley @djowel @Flast I get this kind of errors:

/home/feelpp/feelpp/feel/feeldiscr/functionspace.hpp:5358:31: error: field has incomplete type 'Feel::FunctionSpace<Feel::Mesh<Simplex<3, 2, 3> >,
      Feel::detail::bases<Feel::Lagrange<1, Scalar, Feel::Continuous, PointSetEquiSpaced, 0> >, double, Feel::Periodicity<Feel::NoPeriodicity>, Feel::mortars<Feel::NoMortar>
      >::functionspace_vector_type' (aka 'vector<boost::shared_ptr<Feel::FunctionSpace<Feel::Mesh<Simplex<3, 2, 3> >, Feel::detail::bases<Feel::Lagrange<1, Scalar,
      Feel::Continuous, PointSetEquiSpaced, 0> >, double, Feel::Periodicity<Feel::NoPeriodicity>, Feel::mortars<Feel::NoMortar> > > >')
    functionspace_vector_type M_functionspaces;
                              ^
/usr/include/boost/fusion/container/vector/vector.hpp:250:61: note: in instantiation of template class 'Feel::FunctionSpace<Feel::Mesh<Simplex<3, 2, 3> >,
      Feel::detail::bases<Feel::Lagrange<1, Scalar, Feel::Continuous, PointSetEquiSpaced, 0> >, double, Feel::Periodicity<Feel::NoPeriodicity>, Feel::mortars<Feel::NoMortar> >'
      requested here
            auto at_impl(J) -> decltype(at_detail<J::value>(&std::declval<vector_data&>()))                                                      ^

This is open-source code here and I can produce the relevant code.
it also produces some weird error messages at some simple mpl/fusion code like

/usr/include/boost/mpl/fold.hpp:34:44: error: no member named 'value' in 'boost::mpl::O1_size<boost::fusion::vector<boost::shared_ptr<Feel::FunctionSpace<Feel::Mesh<Hypercube<3,
      1, 3> >, Feel::detail::bases<Feel::Lagrange<1, Scalar, Feel::Continuous, PointSetEquiSpaced, 0> >, double, Feel::Periodicity<Feel::NoPeriodicity>,
      Feel::mortars<Feel::NoMortar> > > > >'
          ::boost::mpl::O1_size<Sequence>::value
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

the c++ code looks like

typedef typename mpl::transform<functionspace_vector_type, ChangeMeshSupport<mpl::_1>, mpl::back_inserter<fusion::vector<> > >::type mesh_support_vector_type;

where ChangeMeshSupport is a very simple class.
I was looking initially into this, but the culprit was the change you committed and which produced the first error I reported

@prudhomm
Copy link

so basically the code cannot use boost starting from 1.67 due to this since it relies heavily on fusion

@Kojoley
Copy link
Contributor Author

Kojoley commented Aug 18, 2018

It is very strange, I do not see any problems in Regression. What is your compiler? Do you have a MWE?

@prudhomm
Copy link

clang >= 4

@prudhomm
Copy link

prudhomm commented Aug 18, 2018

@Kojoley could it be possible to have boost macros to change the PR and detect the supported vs unsupported compilers and select the corresponding implementation ?

@Kojoley
Copy link
Contributor Author

Kojoley commented Aug 18, 2018

I am fine with reverting the PR (since it targeted somewhat outdated compilers), however I do not understand how it broke.
Do you inherit from fusion types and may be overload address-of operator?

@prudhomm
Copy link

prudhomm commented Aug 18, 2018

indeed I sometimes have class inheriting from fusion types

@Flast
Copy link
Collaborator

Flast commented Aug 30, 2018

Sorry for late reply.

@prudhomm can you show me reproducible code (minimal is better but not required)?

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.

None yet

4 participants