facebook / wangle

Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.
Apache License 2.0
3.05k stars 539 forks source link

Current build fails due to Async.h #33

Closed mjs6643 closed 8 years ago

mjs6643 commented 8 years ago

I ran into this compilation error with gcc 5.3 and Ubuntu 14.04. It looks like the issue is because -std=c++0x is set in CMakeLists.txt instead of -std=c++14. Since there are no dependencies on this header I just removed it from the build order for now.

In file included from /home/vagrant/wangle/wangle/concurrent/test/AsyncTest.cpp:12:0: /home/vagrant/wangle/wangle/../wangle/concurrent/Async.h:18:18: error: ‘async’ function uses ‘auto’ type specifier without trailing return type auto async(F&& fn) { ^ /home/vagrant/wangle/wangle/../wangle/concurrent/Async.h:18:18: note: deduced return type only available with -std=c++14 or -std=gnu++14 /home/vagrant/wangle/wangle/concurrent/test/AsyncTest.cpp: In member function ‘virtual void AsyncFunc_manual_executor_Test::TestBody()’: /home/vagrant/wangle/wangle/concurrent/test/AsyncTest.cpp:22:34: error: invalid use of ‘auto’ auto f = async([]{ return 42; }); ^ /home/vagrant/wangle/wangle/concurrent/test/AsyncTest.cpp: In member function ‘virtual void AsyncFunc_value_lambda_Test::TestBody()’: /home/vagrant/wangle/wangle/concurrent/test/AsyncTest.cpp:31:29: error: invalid use of ‘auto’ auto future = async(lambda); ^ /home/vagrant/wangle/wangle/concurrent/test/AsyncTest.cpp: In member function ‘virtual void AsyncFunc_void_lambda_Test::TestBody()’: /home/vagrant/wangle/wangle/concurrent/test/AsyncTest.cpp:37:29: error: invalid use of ‘auto’ auto future = async(lambda); ^ /home/vagrant/wangle/wangle/concurrent/test/AsyncTest.cpp: In member function ‘virtual void AsyncFunc_moveonly_lambda_Test::TestBody()’: /home/vagrant/wangle/wangle/concurrent/test/AsyncTest.cpp:44:29: error: invalid use of ‘auto’ auto future = async(lambda); ^ make[2]: * [CMakeFiles/AsyncTest.dir/concurrent/test/AsyncTest.cpp.o] Error 1 make[1]: * [CMakeFiles/AsyncTest.dir/all] Error 2 make: *\ [all] Error 2```

elliottneilclark commented 8 years ago

I think this has been fixed now that 1y is now the default.