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

fseq.cpp doesn't compile with g++ #5

Open
nickbailey opened this issue Mar 12, 2020 · 1 comment
Open

fseq.cpp doesn't compile with g++ #5

nickbailey opened this issue Mar 12, 2020 · 1 comment

Comments

@nickbailey
Copy link

nickbailey commented Mar 12, 2020

I fully understand you're targeting clang++ but everything else compiles with g++ -std=c++17 -fno-exceptions -fno-rtti -nodefaultlibs -fPIC -O2 -c -o ...

g++ (version 8.3.0) dislikes some templates:

fseq.cpp:830:26: error: could not convert ‘ss.F::_SeqSingle::t[0]’ from ‘const Tree’ {aka ‘const F::Union<F::_Boxed<F::_FragHeader>, F::Tree2, F::Tree3>’} to ‘F::Frag’ {aka ‘F::_Boxed<F::_FragHeader>’}
             return ss.t[0];

etc. Maybe it's just a case of selecting the right field in the union? It should return the first one, I guess? Or is it that the const qualifier is dropped? I found the definition of Union in fvalue.h but it's not obvious to me how it works yet.

Maybe you don't mind about g++ compatibility, but it would certainly increase your user-base among those for whom it's not easy to install clang.

@nickbailey
Copy link
Author

That took me a while...
The following patch allows you to build libf++ with g++ and it still passes all the tests.

g++.patch.txt

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

1 participant