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

Compilation fails with gcc-9/gcc-10 due to lambda captures #3

Open
XapaJIaMnu opened this issue Aug 17, 2020 · 0 comments
Open

Compilation fails with gcc-9/gcc-10 due to lambda captures #3

XapaJIaMnu opened this issue Aug 17, 2020 · 0 comments

Comments

@XapaJIaMnu
Copy link

Hey,

Trying to compile this with gcc-9/10 results in the following error:

[ 59%] Building CXX object 3rd_party/marian/src/CMakeFiles/marian.dir/common/cli_wrapper.cpp.o
In file included from /mnt/Storage/mts/src/./service/api/rapidjson_utils.h:10,
                 from /mnt/Storage/mts/src/service/api/bergamot/node_translation.cpp:2:
/mnt/Storage/mts/src/./service/common/translation_service.h:92:52: error: non-local lambda expression cannot have a capture-default
   92 |        std::function<void (Ptr<Job> j)> callback =[=](Ptr<Job> j){return;});
      |                                                    ^
In file included from /mnt/Storage/mts/src/service/common/plaintext_translation.cpp:2:
/mnt/Storage/mts/src/service/common/translation_service.h:92:52: error: non-local lambda expression cannot have a capture-default
   92 |        std::function<void (Ptr<Job> j)> callback =[=](Ptr<Job> j){return;});
      |                                                    ^
In file included from /mnt/Storage/mts/src/service/api/rapidjson_utils.h:10,
                 from /mnt/Storage/mts/src/service/api/rapidjson_utils.cpp:5:
/mnt/Storage/mts/src/./service/common/translation_service.h:92:52: error: non-local lambda expression cannot have a capture-default
   92 |        std::function<void (Ptr<Job> j)> callback =[=](Ptr<Job> j){return;});
      |                                                    ^
In file included from /mnt/Storage/mts/src/service/api/rapidjson_utils.h:10,
                 from /mnt/Storage/mts/src/service/api/output_options.cpp:3:
/mnt/Storage/mts/src/./service/common/translation_service.h:92:52: error: non-local lambda expression cannot have a capture-default
   92 |        std::function<void (Ptr<Job> j)> callback =[=](Ptr<Job> j){return;});

This change seems to have happened in gcc around 2018: https://patchwork.ozlabs.org/project/gcc/patch/[email protected]/

Removing the = fixes the issue, but I'm not sure if this is the right thing to do.

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