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

Build Errors Examples Using LLVM/Clang on Windows #206

Open
adam-hartshorne opened this issue Sep 20, 2018 · 4 comments
Open

Build Errors Examples Using LLVM/Clang on Windows #206

adam-hartshorne opened this issue Sep 20, 2018 · 4 comments

Comments

@adam-hartshorne
Copy link

The following two bits of code compile ok with MSVC, but using LLVM/Clang produces the following errors.

Using the code in print.cpp

BOOST_HOF_STATIC_FUNCTION(simple_print) = fix(first_of(
    BOOST_HOF_LIFT(print_with_cout),
    BOOST_HOF_LIFT(print_with_range),
    BOOST_HOF_LIFT(print_with_tuple)
));

produces the following error

1>./boost_hof_functions.h(45): error : templates cannot be declared inside of a local class
1>C:\boost_1_68_0\boost/hof/lift.hpp(90):  note: expanded from macro 'BOOST_HOF_LIFT'
1>C:\boost_1_68_0\boost/hof/lift.hpp(105):  note: expanded from macro 'BOOST_HOF_LIFT_CLASS'

And

BOOST_HOF_STATIC_LAMBDA_FUNCTION(print) = boost::hof::proj(simple_print);

produces

>./boost_hof_functions.h(51): error : non-const lvalue reference to type 'reveal_adaptor<...>' cannot bind to a temporary of type 'reveal_adaptor<...>'
1>C:\boost_1_68_0\boost/hof/lambda.hpp(241):  note: expanded from macro 'BOOST_HOF_STATIC_LAMBDA_FUNCTION']

There are nearly identical errors with functions from in.cpp.

@pfultz2
Copy link
Collaborator

pfultz2 commented Sep 20, 2018

So it looks like clang on windows defines _MSC_VER on windows. This should be easy to fix for BOOST_HOF_LIFT.

The other issues I am not sure what the error is. It seems related to #205 as well. Let me look into setting up clang for windows unless you have a dockerfile that sets it up already.

@adam-hartshorne
Copy link
Author

Sorry I don't have a docker file.

It is however extremely straight forward to drop LLVM/Clang into Visual Studio these days.

@pfultz2
Copy link
Collaborator

pfultz2 commented Sep 20, 2018

It is however extremely straight forward to drop LLVM/Clang into Visual Studio these days.

I dont have access to windows. Although, clang is portable and will run on any platform.

@adam-hartshorne
Copy link
Author

adam-hartshorne commented Nov 28, 2018

Was a fix ever found for this?

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

2 participants